You should do either one of those two options: 1. Use TaskStackBuilder (or your own code) to construct a complete activity stack representing the state the user is going to into the app from the notification, completely replacing whatever the current task is. 2. Use android:taskAffinity to make the activity be a completely separate task from the main task of your app.
What you describe is that you are doing (1) but not actually building a complete task stack (that is, not starting multiple activities with the first being the root activity of your task). On Tue, Jun 26, 2012 at 3:40 PM, Brett <[email protected]> wrote: > Hey Dianne, > > That is actually what I'm trying to do. I set the clear flag so that the > app essentially starts over. But my problem is that this flag and extras > info replaces the recent application list intent. So now if I go home and > re-launch the app from the recent list it always clears away everything > from that point on. Is there any way to create a notification that will > send an intent that doesn't replace the recent app list data? > > --Brett > > > On Tuesday, June 26, 2012 3:29:10 PM UTC-7, Dianne Hackborn wrote: >> >> As per the current UI guidelines, a notification should either go to a >> complete activity back stack (entirely replacing whatever your current task >> is), or it should launch an activity that is entirely separate from your >> main activity's task. >> >> For the former, you can use things like http://developer.android.** >> com/reference/android/support/**v4/app/TaskStackBuilder.html<http://developer.android.com/reference/android/support/v4/app/TaskStackBuilder.html> >> >> For the latter, you can set your android:taskAffinity="" for that >> activity in your manifest so that it is not considered to be part of the >> main task of the app. >> >> On Tue, Jun 26, 2012 at 2:47 PM, Brett <[email protected]> wrote: >> >>> I'm having nothing but trouble with something that seems pretty basic. >>> >>> So I have a notification set up so that it launches to my main activity >>> with SINGLE_TOP and CLEAR_TOP. All this works well and I act accordingly >>> to the notification. But what happens is that in the recent app list (if >>> you hold down home or on ICS click on task switcher) that intent is now >>> the notification intent instead of the typical bring to front your whole >>> activity. For instance, if I launch a new activity from my main task, then >>> click home, then go to the recent app list and click it, I get the clear >>> top again with my original notification extras. >>> >>> I've tried every combination of things I can think of to try and get >>> this to work with no solution in sight. No matter what I do, whatever my >>> notification parameters and extras are, they are maintained in the recent >>> applications. >>> >>> How can I send a notification intent to my app without it hijacking the >>> recent application list? Btw, if I do the FLAG_ACTIVITY_NO_HISTORY, then >>> nothing is in the recent applications. >>> >>> Any thoughts? >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Android Developers" group. >>> To post to this group, send email to android-developers@** >>> googlegroups.com <[email protected]> >>> To unsubscribe from this group, send email to >>> android-developers+**[email protected]<android-developers%[email protected]> >>> For more options, visit this group at >>> http://groups.google.com/**group/android-developers?hl=en<http://groups.google.com/group/android-developers?hl=en> >> >> >> >> >> -- >> Dianne Hackborn >> Android framework engineer >> [email protected] >> >> Note: please don't send private questions to me, as I don't have time to >> provide private support, and so won't reply to such e-mails. All such >> questions should be posted on public forums, where I and others can see and >> answer them. >> >> -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en > -- Dianne Hackborn Android framework engineer [email protected] Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

