Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

single instance of an activity in android

I know single instance can be achived by setting android:launchMode="singleInstance" in menifest file. but i want to do it on run time . I think it can be achived by setting FLAG but not sure witch one.. plzz help me.. thanks in advance.

like image 634
grv_9098 Avatar asked Jul 19 '12 07:07

grv_9098


1 Answers

In general you can use a combination of Intent.FLAG_ACTIVITY_SINGLE_TOP, Intent.FLAG_ACTIVITY_CLEAR_TOP, Intent.FLAG_ACTIVITY_REORDER_TO_FRONT and Intent.FLAG_ACTIVITY_NEW_TASK to accomplish what you want. However, which one (or ones) to use depends on the situation you have.

like image 141
David Wasser Avatar answered Nov 09 '22 20:11

David Wasser