Swipe between activities

2019-01-20 15:51发布

问题:

I want to swipe between activities, but I'm not sure what best practices would be.

Should I throw everything in at once and scroll from each activity?...and does that create memory problems?

Or am I better off implementing an actual swipe?

Are there other methods I should consider?

The end-game will be 10-15 Activities filled with HTML, making up a magazine...so I want the user to be able to swipe from each article (which will be 1 per activity) to another.

Thanks!

回答1:

You could also use GestureDetector and OnGestureListener to launch a new Intent when a fling is detected with public boolean onFling().

Personally I would use the ViewPager as described by kabuko.



回答2:

You want the ViewPager. Read this blog post on it.