"FLAG_ACTIVITY_CLEAR_TOP - If set, and the activity being launched is
already running in the current task, then instead of launching a new
instance of that activity, all of the other activities on top of it
will be closed and this Intent will be delivered to the (now on top)
old activity as a new Intent. "

Sadly this one doesn't help since it only clears the stack if the
launched activity is already running in the task somewhere (and that's
not the case here, sadly :( )


Tauno


On Tue, Sep 22, 2009 at 12:17 PM, Andrei Bucur <andrei.bu...@gmail.com> wrote:
> http://developer.android.com/reference/android/content/Intent.html#FLAG_ACTIVITY_CLEAR_TOP
>
> On Tue, Sep 22, 2009 at 11:26 AM, tauntz <tau...@gmail.com> wrote:
>>
>> Hi
>>
>> Activities:
>> A & B  are activities that once you have navigated away from them,
>> it's not logical that you can get back to them using the back button.
>> C ... X are activities that follow the usual "can go back to where you
>> came from" flow.
>>
>> App flow:
>> * Launch app from Home -> starts A
>> * From A start B
>> * Finish A (removes it from stack)
>> * From B start C
>> * Finish B (removes it from stack)
>> * From C start D
>> * From D start E
>>
>> Once the user has reached E, the activity stack looks like this: C -> D ->
>> E.
>>
>> Can I somehow reset the whole stack so it starts again at A so it's as
>> the user just launched it from Home (so that C... E are removed from
>> the history stack)?
>>
>> From
>> http://developer.android.com/guide/topics/fundamentals.html#clearstack:
>> In my case alwaysRetainTaskState = true, clearTaskOnLaunch = false,
>> finishOnTaskLaunch = false, because it's logical that the user
>> continues in the same activity where he left - even after long periods
>> of time. Even if alwaysRetainTaskState was false, it would still not
>> address my problem of "manually" clearing the stack at a random point
>> in time from within the application.
>> "There's another way to force activities to be removed from the stack.
>> If an Intent object includes the FLAG_ACTIVITY_CLEAR_TOP flag, and the
>> target task already has an instance of the type of activity that
>> should handle the intent in its stack, all activities above that
>> instance are cleared away so that it stands at the top of the stack
>> and can respond to the intent." - that also doesn't work for me since
>> A isn't in the stack so launching it with that flag won't clear
>> anything from the stack :(
>>
>>
>> Tauno
>>
>>
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to