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)
Actually, clearAllTabs does that :
And the method removeAllViews comes from the class
ViewGroup. Luckily,ViewGroupdoes have methods to remove only one view :removeView(View view)removeViewAt(int index)removeViewInLayout(View view)Knowing that, I would recommend to subclass
TabWidgetandTabHostto add the behaviour you need. Maybe there is an easier way but that’s the only one I can think of.Good luck