How to change the title of the Tab Dynamically

前端 未结 3 1990
花落未央
花落未央 2020-12-11 18:14

I have three tabs in my Application. On an event under one Tab, i want to change the title of an another existing Tab. This is the title that we provide while adding the tab

3条回答
  •  有刺的猬
    2020-12-11 18:48

    You should not use anymore "TabHost" for ICS, it has been deprecated in version 13. instead you need to you "ActionBar"...

    Tab mTab = super.getSupportActionBar().getTabAt(0); 
    mTab.setText("new Title");
    

    Android will refresh the tab right away

提交回复
热议问题