简体   繁体   中英

Handling tabs, actionbar, activities and fragments

I am facing problem in designing following scenario :

  1. Showing 3 tabs for contact-lists (all, friends and family)
  2. All tabs would contain contact-list as per the groups
  3. Any contact could be selected and viewed but should be in the same tab (either all,family or frnds)
  4. In short, tabs should be available globally.

Here, I decided to use ActionBar and to change the view by using fragments to be called from onTabSelected() of TabListener ; in which I was confused as I have to keep only single activity but multiple fragments. 'Keeping single activity' is this a standard / valid approach ? Please suggest.

Thanks in advance.

I know this is late, but I used a tabhost with fragments to do something similar. Here's a nice tutorial. http://thepseudocoder.wordpress.com/2011/10/04/android-tabs-the-fragment-way/

您应该有一个Activity,并有一个容器(可以是一个空的LinearLayout),其中根据所选的选项卡替换了片段。

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