I need only one instance of my app, so I use android:launchMode="singleInstance"
in main activity section in manifest, but this causes: when I click on home button when second activity is displayed and launch my app again, main activity is displayed, but I need to display second activity (I need standard behaviour). Problem is caused by using singleInstance
in activity's manifest so this activity is always on top. I tried to launch second activity with various flags, but this doesn't work. (android:launchMode="singleTask"
doesn't work too).
Asked
Active
Viewed 858 times
2

Dmitrii Leonov
- 1,331
- 1
- 15
- 25

Palejandro
- 2,092
- 5
- 26
- 38
-
Palejandro, can you explain why the standard launch mode isn't working for you? Perhaps then I can offer a solution. – David Wasser Mar 29 '12 at 14:55
-
Hi David, I've already solved my problem, I did it in different way. It wasnt standard application. It was about voting and I didnt want users to vote twice or more. The solution is in the second app which accepts only first vote from individual user :P – Palejandro Mar 30 '12 at 17:47
1 Answers
0
singleInstance
and singleTask
are only needed in very rare cases.
You probably don't need any special launch mode to get the behaviour you want. Just try the standard launch mode and see what happens. In most cases you don't need any special launch mode unless your application is started by other applications and you want to be able to control that.
If you try the standard launch mode and have problems, please indicate what the problem is in more detail and we can probably help you.

David Wasser
- 93,459
- 16
- 209
- 274