Android: TabHost How To: set new content in existing tabs upon menu button?
- by Martin D.
Hello stackoverflow,
I recently started Android programming and was working on my first program which displays a historic text document, sectioned by tabs via TabHost. I have limited my program to one activity and merely used setContent in my TabSpec's to switch between different XML views.
The document has both unedited and corrected versions of the text for which I have built text views to accommodate. I wanted to implement the standard menu to have buttons to "view corrected" and "view original" and switch the content of the tabs which have changes (without altering the tabs or their indicators).
I've read on the TabHost API and there is no way to edit existing tab content with setContent() of TabSpec; and AFAIK TabWidget only affects the actual tabs, not the content that is displayed upon pressing them.
I've thought about creating a new class which extended TabHost and super() all of the original methods, while including one more which updated the mTabSpec list.
My question would be, how would I update the frameLayout view of a specific tab to display content I specify?