1

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

Chiggins
  • 8,197
  • 22
  • 56
  • 81
  • Can you explain what you mean with "original activity"? You have a tabbed view, so you have a bunch of tabs, each one with individual activities that you switch inbetween using tabs. Where's the "original" activity? – EboMike Aug 04 '10 at 21:41
  • The "original" activity is the activity within the tab, when the tab is first selected – Chiggins Aug 04 '10 at 21:48
  • Do you mean that you want to (inside of the active tab) replace the `Activity` that was set with `setContent` for the `TabSpec` to a new/different `Intent` and then after some processing switch the content back to the original `Activity` that was displayed, all without appearing as though you have left the active tab? – Quintin Robinson Aug 04 '10 at 22:24

1 Answers1

0

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.

EboMike
  • 76,846
  • 14
  • 164
  • 167