I need only one instance of my app in android. If I run my app after installation and go to Home screen, and again run my app (click on app's icon), second instance is opened, I need to open already running first instance not to run second instance. I don't know how to solve this.
Asked
Active
Viewed 1.9k times
1 Answers
25
Use android:launchMode="singleTask"
or android:launchMode="singleInstance"
in your manifest.xml in your activity
tag

Vishwajit Palankar
- 3,033
- 3
- 28
- 48

Vyacheslav Shylkin
- 9,741
- 5
- 39
- 34
-
2What is difference of singleTask and singleInstance? – AVEbrahimi Jun 14 '14 at 10:37
-
1Take a look: http://stackoverflow.com/questions/3219726/android-singletask-or-singleinstance-launch-mode – Vyacheslav Shylkin Jun 14 '14 at 19:49
-
@Zapnologica It is too late but on your Launcher activity. – Amir Shabani Sep 14 '19 at 06:09