On Tue, Nov 8, 2011 at 8:00 AM, Neilz <[email protected]> wrote: > Ok, I have a related, but unrelated, question about this! More about > managing Activities and Intents, but within the above scenario. > > Let's say my app has started ActivityA, ActivityB, and ActivityC. This > last activity opens the browser, which does its stuff until the user > clicks the link (discussed above) which returns the user to my app, > but in the case a new ActivityD. > > The small issue I have here is that the browser activity remains in > the stack. Ideally I want it finished somehow. Even if I go from > ActivityD back to ActivityC (setting > Intent.FLAG_ACTIVITY_PREVIOUS_IS_TOP), the browser activity is still > next in line. Once I've returned to C, I want to be able to continue > as if the browser had never opened, back to B and then A etc. > > Can this be achieved?
Not that I am aware of. You have no right to get rid of the browser, any more than the browser has the right to get rid of you. If you need that level of control, you'll probably need to use a WebView in your own activity rather than the browser. Or consolidate your app such that there is simply one Activity ABCD where you are handling your own back stack (e.g., using dynamic fragments), with an Intent triggered by the browser that includes FLAG_ACTIVITY_REORDER_TO_FRONT, so the existing ABCD instance is reused and you get the Intent in onNewIntent(). -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy _Android Programming Tutorials_ Version 4.1 Available! -- 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

