Android. How to change Activity within a Tab

前端 未结 4 2262
面向向阳花
面向向阳花 2020-12-07 17:03

Following situation: I have TabActivity with e.g. three tabs, TabA, TabB, TabC.

There are a button in activity (Act_C_1) of TabC. So if the user clicks on that butto

4条回答
  •  醉梦人生
    2020-12-07 17:29

    Just add this for all tabs:

    yourTabHost.getChildAt(0).setOnClickListener(new OnClickListener() {
        public void onClick(View v) {
            getTabHost().setCurrentTab(0);
        }
    });
    

提交回复
热议问题