Here's a simple solution:

A startActivityForResult -> B startActivityForResult -> C and when
user goes to D, finish C with RESULT_OK (or any result code you want).
Then finish B itself when receive the result in onActivityResult

There's a limitation about this solution is that B and A won't
actually be destroyed until user exit D. However, this is not
noticeable by the user.

-Scott
On Dec 24, 5:33 am, jotobjects <[email protected]> wrote:
> Assuming A,B,C,D are in the same application, a possible solution is
> for A and D to be sub-activities of an ActivityGroup AD.  AD is the
> main app activity that normally starts A but with some intent (and
> with FLAG_ACTIVITY_CLEAR_TOP)  will instead start D.
>
> On Dec 23, 9:17 am, Sam <[email protected]> wrote:
>
> > Anyone? There must be someone else who has ran into a similiar issue.
>
> > On Dec 22, 12:41 pm, Sam <[email protected]> wrote:
>
> > > All the current discussions involves clearing all activites above an
> > > existing activyt, but I'm trying to find a way to clear all the
> > > activities before the latest activity in the stack.
>
> > > So my scenario is A -> B -> C and then when a user goes to Activity D,
> > > activies A,B,C should be cleared from the activity stack.
> > > FLAG_ACTIVITY_CLEAR_TOP seems to only clear any activites above an
> > > existing activity.
>
> > > Anybody run into this scenario and found a solution?

-- 
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

Reply via email to