From fa9b5cae646ab1461c9f0f4b170c941e3da7c740 Mon Sep 17 00:00:00 2001
From: Dianne Hackborn android:launchMode="singleInstance" and
+android:launchMode="singleTask",
+android:taskAffinity="" and
android:excludeFromRecents="true"
must be set. The full activity declaration for this sample is:
Because of the use of singleInstance, you must be careful about launching
-any other activities from this one. These activities will be launched
-in their own task, and care must be taken to make sure this interacts
-well with the current state of your application's task. This is essentially
+
You must be careful when launching other activities from this initial activity,
+because this is not a top-level part of the application, does not appear in
+recents, and needs to be relaunched at any point from the notification with new data
+to show. This best approach is to make sure any activity launched from it is
+launched in its own task. When doing this care must be taken to make sure this
+new task interacts well with the current state of your exiting application's
+task. This is essentially
the same as switching to the main application as described for the Email style
notification shown before. Given the makeMessageIntentStack()
-method previously shown, handling a click here would look something like this:
If you don't want to use the singleInstance launch mode for
-this activity, an alternative approach is to use android:taskAffinity="".
-This tells Android that the activity should not be treated as part of the
-main application flow, so it will not get mixed together with that. All of the
-other issues discussed here do still apply, though this would allow you to start
-additional activities that are part of this notification task instead of switching
-to and replacing the main application task.
The {@link android.app.NotificationManager} is a system service that manages all -- cgit v1.2.3-59-g8ed1b