开发者

tabview - last visited tab activity

I have a TabActivity with 5 tabs in it and each tab has an activity defined. Irrespective of which ever t开发者_C百科ab i click, when the tabactivity screen is loaded, it always displays the first tab. Is there a way to get the last tab visited? thanks..


Store the tab in a sharedpreference, and then when the activity hosting the tab is shown, set the tab.

@Override
    public void onTabChanged(String tabId) {

    }

or this

tabHost.getCurrentTab()

store the tab ID or index and then set it using,

 tabHost.setCurrentTab(index);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜