TabHost remove Tab

by Ahmy » Mon, 16 Jun 2008 12:04:32 GMT


Sponsored Links
 Hello all

I'm successfully create a tab using TabHost and TabHost.TabSpec.
i found an addTab method but not removeTab.
there is also clearAllTabs(boolean).  but that will remove all the
tab;
is there any way to remove tab by its tag name ?

oh and i created the tab programatically or by code.

thanx b4,

--~--~---------~--~----~------------~-------~--~----~



TabHost remove Tab

by Josh Guilfoyle » Thu, 19 Jun 2008 10:02:31 GMT


 You can't currently.  I don't believe this is an inherent deficiency
in the design of TabHost, but rather that you ought not construct a UI
that behaves this way.  You are presuming to reveal a tab to the user
and then hide it through some event.  Will this be extremely clear to
your user why they have lost functionality?  Perhaps disabling tabs
makes more sense for your UI, or designing separate activities
entirely.



--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


TabHost remove Tab

by Ahmy » Tue, 24 Jun 2008 19:20:11 GMT


 mm.. basically im creating a client messenger. the tab reveal when
user wants to chat to some user.
and the tab close when user no longer want to see the chat window.
the reason im doing this is because i just wanted a single activity.
and its only for testing my client messenger library.
single activity can reduce the complexity because the activity only
for a sample of how using this library.

thanks any way




--~--~---------~--~----~------------~-------~--~----~



TabHost remove Tab

by Mark Murphy » Tue, 24 Jun 2008 23:03:50 GMT


 


Have you tried removeView() on both the TabHost and TabWidget? That 
method should be available on both, since they inherit from ViewGroup. 
Calling it to remove the tab details and the tab itself from the host 
and widget, respectively, might do the trick.

If that doesn't work -- and I hate to sound like a broken record here -- 
  you could "roll your own" tab-like view using ViewFlipper, where 
removeView() should work.

-- 
Mark Murphy (a Commons Guy)
 http://commonsware.com 
Warescription: All titles, revisions, & ebook formats, just $35/year

--~--~---------~--~----~------------~-------~--~----~



TabHost remove Tab

by Guillaume Perrot » Wed, 25 Jun 2008 00:16:17 GMT


 I had the same problem.
I used removeViewAt(int position) on the TabWidget and it worked for
me.
The same didn't work directly on TabHost (ArrayOutOfBoundException).






--~--~---------~--~----~------------~-------~--~----~



TabHost remove Tab

by Guillaume Perrot » Wed, 25 Jun 2008 21:06:46 GMT


 In fact it seems to have side-effects to use
myTabHost.getTabWidget().removeViewAt().
I have two tabs : A B
I delete B, i add C (at the end).
When clicking on C (the indicator is good), i see B's content which
was removed !
When adding tab D at the end, i see C's content !
And so on...
I think it's currently impossible to remove a tab making TabHost
completely useless for creating a IM application... I'm gonna think of
a different way to build my UI (like using buttons to replace tabs and
switching the view when clicking on a button).





--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Tanya soal froyo di journey

Dear all,
Mau nanya nih :
1. Setelah naik dari eclair ke froyo official kok games seperti angry birds gak 
bisa di install yah.. Baik dari market maupun offline (from sd card)

2. Kenapa sd card sering damage ya? Kalo damage harus di format lg baru 
bener... Cape nih datanya ilang mulu :(

Thanks...
Sent from my BlackBerry via Smart 1x / EVDO Network. Smart.Hebat.Hemat.

-- 
===============

2. Honeycomb running on HTC Desire HD, Evo and Droid Incredible. Ported Droid Incredible. Ported from Android 3.0 SDk(Download)

Mampir disini ya :-)

http://getandroidstuff.com/honeycomb-running-htc-desire-hd-evo-droid-incredible-ported-android-30-sdk-download/

-- 
===============

3. How to Find Specific Nearby Locations in android

4. [WTS] Aksesoris buat HTC Series (DHD,Nexus S dll),Samsung Galaxy S dan Samsung Galaxy Tab

5. Nokia Menikah dengan Microsoft akhirnya

6. {WTB} silicon case LG GT540

7. How to create Virtual Network Interface on Android