Two tabs for android: TabActivity and ActivityGroup
Http://www.apkbus.com/blog-70574-40942.html
1. Single Activity Architecture (recommended)
The homepage is Activity, where the page is View
- The bottom column of the header is public, but the text and pattern are changed.
- The navigation bar at the bottom is RadioButton.
- Slide switching is supported in the middle part.
- The page jumps quickly, but the homepage is not smooth.
The advantage of this architecture is that the idea is clear and the system running overhead is small. The disadvantage is that the Code is messy if the control is not good, and the lifecycle is not easy to manage.
2. Multiple activities-use BaseActivity to provide commonalities
3. Multiple activities-use TabActivity
MainActivity (TabActivity)-> sub-Activity (BaseActivty)
- Clear code and ideas
- BaseActivity has the same backend and header bottom columns.
3.1 MainActivity (TabActivity)-> subactivity (ActivityGroup)-> grandson Activity (BaseActivty)
PS: Suitable for jump of multiple activities in one TabHost
3.2 combine Radiobutton and TabActivity to jump (the code is very clear)
4. Multiple Activity-ActivityGroup (officially marked as not recommended)
The Bottom Bar is implemented using the GridView, and the bottom is also implemented using RadioButton.
Forwarded to: http://www.cnblogs.com/TseChiHoi/archive/2012/09/06/2673978.html