6

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.

Anoop M Maddasseri
  • 10,213
  • 3
  • 52
  • 73
dora
  • 2,047
  • 3
  • 18
  • 20
  • Something isn't quite right here. How did you launch your app for the first time? From the HOME screen via app icon? or from Android Studio or the installer? You may be seeing a very nasty longstanding Android bug. – David Wasser Dec 27 '19 at 14:47
  • Are both instances in the same task? Or are they in different tasks? Can you paste the entire relevant output from `adb shell dumpsys activity activities`? – David Wasser Dec 27 '19 at 14:49
  • I realize this question is 5 months old. Have you gotten anywhere in solving it? – David Wasser Apr 19 '20 at 15:20

1 Answers1

0

What flag is it - 0x10200000 ?

Answer- https://stackoverflow.com/a/29875943/4694013

enter image description here

Anoop M Maddasseri
  • 10,213
  • 3
  • 52
  • 73
  • 0x10000000 corresponds to FLAG_ACTIVITY_NEW_TASK. 0x10200000 corresponds to what ? – dora Dec 02 '19 at 17:17
  • as you can see in the image you shared, it is mentioned that singleTask and singleInstance do not launch Multiple Instances even though they are from different processes. – dora Dec 02 '19 at 19:44
  • 1
    This is just wrong. The whole point of these special launch modes is to prevent multiple instances, especially when being launched from multiple tasks. – David Wasser Dec 27 '19 at 14:49