Changing Activities within Tab
Alright, so I have an application that has a tabbed interface. What I would like to know is how I can change the currently active Activity in the tab, and then when I'm done with that Activity开发者_StackOverflow中文版, go back the the original Activity, exactly as it was.
Would I be able to use something like a ViewFlipper for this? Or probably not?
If you're just concerned about what happens in the activity within that particular tab, the normal rules of activites apply, i.e. as if this activity were the only one in your application: You can either use Activity.finish()
to go back to the previous activity on the stack, or use a ViewFlipper or something to randomly switch between various activities.
Another (discouraged) way would be to remove all views and then call setContentView() to inflate a new layout, but the above ways would be preferred.
精彩评论