how to Keep Tabhost when start other activity

前端 未结 3 950
遇见更好的自我
遇见更好的自我 2021-01-07 17:22

I have a problem with TabHost...

I have TabBarActivity class flow as :

public class TabBarActivity extends TabActivity implements OnTabChangeListener{

<
3条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-07 17:48

    How to use:

    In one tab of some tabs such as 4 tabs, every tab extends the TabActivity, in witch u start your really activity using the method startChildActivity.

    code

    public class Tab_BookCityActivity extends TabGroupActivity {
    
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        startChildActivity("BookCityActivity", new Intent(this, BookCityActivity.class));
    
        }
    }
    

提交回复
热议问题