Two instances of an Activity with launchMode as singleTask


I have an activity with launchMode as singleTask. But for some reason, two instances exist when I try to look for logs in "adb shell dumpsys activity activites" . The first instance is launched with
intent={act= flg=0x10000000 cmp=} and the second one is launched with below intent
intent= { act= flg=0x10200000 cmp= (has extras)} . What flag is it?

Actually the second intent is launched by a different app. How to prevent that app to launch new instance of my activity.

asked on Stack Overflow Dec 2, 2019 by dora • edited Dec 2, 2019 by Anoop M

1 Answer


It works as intended. Activity with launch mode singleTask/singleInstance will create a new instance while launching from different processes. Basically instance will be single in the same process.

What flag is it - 0x10200000 ?


enter image description here

answered on Stack Overflow Dec 2, 2019 by Anoop M • edited Dec 30, 2019 by Anoop M

User contributions licensed under CC BY-SA 3.0