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).
On 24 juin, 18:13, Guillaume Perrot <[EMAIL PROTECTED]> wrote: > 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). > > On 24 juin, 17:03, Mark Murphy <[EMAIL PROTECTED]> wrote: > > > Ahmy wrote: > > > 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. > > > 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 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

