In simple Java application, if we open it 2 times, 2 app instances will be launched.
AFAIK there are some ways to limit single instance for Java app such as: using FileLock
to lock a RandomAccessFile
& add shutdown hook to release it later when app is shutting down,..
But how it WAS implemented in Android app? Because in Android, when users click on app's icon while this app is running the Android system shows the old app instance rather than creating a new one.