Android Question Remove Tabs from TabHost

Alex_197

Well-Known Member
Licensed User
Longtime User
Hi all

I have a question. I have a TabHost added with designer. My code adds tabs with icons. My question is - is it possible to clear or remove all the tabs before adding the new one?

For example - my code adds 7 tabs for each day of week for a client. Each client has a different schedule - if the client has a schedule for Monday tab icon has a blue background, if not - grey and so on.

So I need to clear all the previously added tabs before adding the new 7 tabs.
 

peacemaker

Expert
Licensed User
Longtime User
Seems, possible just to create and re-create by code.
 
Last edited:
Upvote 0

peacemaker

Expert
Licensed User
Longtime User
Removing is possible, but ... it's wrong way to use it after removing tab.

B4X:
    Dim jo As JavaObject = TabHost1
    Dim jo1 As JavaObject = jo.RunMethodJO("getTabWidget", Null)
    jo1.RunMethodJO("removeViewAt", Array (index))
 

Attachments

  • testt.zip
    9.2 KB · Views: 66
Upvote 0
Top