How to enable only one instance of my application

I need only one instance of my application in Android. If I launched the application after installation and went to the main screen and started the application again (click the application icon), the second instance will open, I need to open the first instance that has already been launched so as not to start the second instance. I do not know how to solve this.

+8
android installation
source share
1 answer

Use android:launchMode="singleTask" or android:launchMode="singleInstance" in your manifest.xml file in the activity tag

+16
source share

All Articles