Swipe between activities

2019-01-20 15:54发布

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!

2条回答
放荡不羁爱自由
2楼-- · 2019-01-20 16:10

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.

查看更多
兄弟一词,经得起流年.
3楼-- · 2019-01-20 16:20

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

查看更多
登录 后发表回答