Android: TabHost without TabActivity

前端 未结 4 1953
旧巷少年郎
旧巷少年郎 2020-11-27 02:56

I want to create tabs without extending TabActivity. (The reason is that TabActivity cannot handle a custom titlebar as it seems). I have

pu         


        
4条回答
  •  伪装坚强ぢ
    2020-11-27 03:19

    Before calling tabHost.setup(mLocalActivityManager); you need to add this line.

    mlam.dispatchCreate(savedInstanceState);
    tabHost.setup(mlam );
    

    similarly, you need to add for onResume,

    mlam.dispatchResume(); 
    

    onPause(),

     mlam.dispatchPause(isFinishing());
    

提交回复
热议问题