简体   繁体   中英

Switching between activities Android

I have an Android app with two classes:
-MainActivity
-SecondActivity
I have also two layouts for these classes (they are pretty similar).
I want to switch between these activities by 'shifting' to the right or to the left.
All materials I find are about switching by button.

Anyone would recommend using Fragments and ViewPager instead of Activity since you want sliding action and make use of the Android TabLayout .

Here is a tutorial that you can draw a basic idea from.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM