1

I have 3 Activity's that i like to put into a ViewFlipper configuration.

Right now i have big trouble going from activity 1-2-3 and back.

what is the best approach to do this?

Any help would be grate?

Erik
  • 5,039
  • 10
  • 63
  • 119

1 Answers1

0

No, ViewFlipper can not contain Activities. Your best bet would be to just use a custom Animation to perform the transition between each Activity: see Can I change the Android startActivity() transition animation? for a decent example. To go back call finish() in each Activity to end it.

EDIT: you want a TabActivity. You can hide the TabWidget and then swipe to switch between tabs.

Community
  • 1
  • 1
Femi
  • 64,273
  • 8
  • 118
  • 148
  • thanks. I cannot finish any of them because the hole user experience is to switch between 3 activity's/screens doing som graphic manipulations in one and setting up values in another. – Erik Jul 11 '11 at 15:18
  • Ah. Well, that particular mechanic is really not something Android is good at: you have a stack of Activities. For what you want maybe you want a TabActivity, hide the TabWidget and then swipe to switch between tabs? – Femi Jul 11 '11 at 15:40
  • was thinking about that tabs. will the activity's stay alive during tab click? – Erik Jul 11 '11 at 16:25
  • 1
    Yep: all Activities in a TabActivity will retain state appropriately. You can then switch tabs programmatically as you so choose. – Femi Jul 11 '11 at 16:27
  • sound like just what i wanted. Im already half way btw. Had an old tabGroup example im fiddling with – Erik Jul 11 '11 at 16:43
  • This works grate thanks. Above my expectations. All three activity's are loaded and i use my buttons to walk back/forw. If anyone want to do the same look at this: http://ericharlow.blogspot.com/2010/09/experience-multiple-android-activities.html – Erik Jul 12 '11 at 08:53
  • @Femia. Im setting your answer as the right one. - Update your answer with "you want a TabActivity, hide the TabWidget and then swipe to switch between tabs" – Erik Jul 12 '11 at 09:49