2

My app has several activities, one of which has life in its own right, so I made a shortcut to it in the manifest via:

        <intent-filter>
            <action android:name="android.intent.action.CREATE_SHORTCUT" />
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>

Now I have it in the Widgets zone. This secondary activity now opens when I click the shortcut that I put in my launcher, as I wanted.

However, there is something that does not work as I want: if the main app is working in the background (say, via the home button), clicking the secondary activity shortcut pop-ups the main app, not the secondary activity.

Why is that? Is this the natural behavior? Is there a way to open the secondary activity always, even side by side with the main app?

Thanks!

L.

Luis A. Florit
  • 2,169
  • 1
  • 33
  • 58

1 Answers1

1

By surfing other stuff I found the solution of this. Just add

 android:launchMode="singleInstance"

in the secondary <activity> in the manifest. Here is the explanation: http://developer.android.com/guide/topics/manifest/activity-element.html#lmode

Luis A. Florit
  • 2,169
  • 1
  • 33
  • 58