Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
491 views
in Technique[技术] by (71.8m points)

android - How to remove tab from TabHost

In a TabHost widget, I can create a new tab with its content (Intent) using TabHost.addTab(TabHost.TabSpec tabSpec).

We can remove all tabs we created by calling clearAllTabs(), but I can't figure out how to remove the tab or just replace the content (Intent) inside the tab with new Intent.

so what I need something like removeTab(int index)

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Much Easier:

 tabHost.getTabWidget().removeView(tabHost.getTabWidget().getChildTabViewAt(3));

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...