Merge "Update documentation to reflect the old approach not working." into ics-mr1
This commit is contained in:
committed by
Android (Google) Code Review
commit
e22f474856
@@ -245,31 +245,27 @@ an application to be part of that application's UI flow, so simply launching the
|
||||
activity like this can cause it to be mixed with your normal application back stack
|
||||
in undesired ways. To make it behave correctly, in the manifest declaration
|
||||
for the activity the attributes
|
||||
<code>android:launchMode="singleInstance"</code> and
|
||||
<code>android:launchMode="singleTask"</code>,
|
||||
<code>android:taskAffinity=""</code> and
|
||||
<code>android:excludeFromRecents="true"</code>
|
||||
must be set. The full activity declaration for this sample is:</p>
|
||||
|
||||
{@sample development/samples/ApiDemos/AndroidManifest.xml interstitial_affinity}
|
||||
|
||||
<p>Because of the use of <code>singleInstance</code>, 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
|
||||
<p>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 <code>makeMessageIntentStack()</code>
|
||||
method previously shown, handling a click here would look something like this:</p>
|
||||
method previously shown, handling a click then would look something like this:</p>
|
||||
|
||||
{@sample development/samples/ApiDemos/src/com/example/android/apis/app/IncomingMessageInterstitial.java
|
||||
app_launch}
|
||||
|
||||
<p>If you don't want to use the <code>singleInstance</code> launch mode for
|
||||
this activity, an alternative approach is to use <code>android:taskAffinity=""</code>.
|
||||
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.</p>
|
||||
|
||||
<h2 id="ManageYourNotifications">Managing your Notifications</h2>
|
||||
|
||||
<p>The {@link android.app.NotificationManager} is a system service that manages all
|
||||
|
||||
Reference in New Issue
Block a user