At the moment i h开发者_Python百科ave big Activity with many views and now i have to switch the content. MUST: OnSwipe i can change between different site (it is the same activity only the content is changed)
Now i finished the Activity but i have no idea how to switch the content. Btw i have no idea what is the best way to do it?!
I thought about an ViewFlipper or an SwitchView but i am not sure if it is the best way, because i dont want to switch views or activities, i only want to switch the content of one activity.
Do you have any idea what is the best way to do this?
I hope anything i clear ennought :) Thanks
The easiest way of listening for a swipe is to use a GestureDetector, then when it calls back to your OnGestureListener with onFling() you know it is time to update your content. Does that help?
If you want to switch it onSwipe, as you've mentioned, the best way is to use ViewFlipper. Otherwise you just use setContentView()
.
精彩评论