Yes but that removes a child view, doesn't it? And this view i want to
remove (the TabHost object) isn't really a child of another view, it's the
first thing in the base LinearLayout. I've also tried with getParent() and
casting to LinearLayout but that gives me an error.

Here's my code below:

        if (tabs!=null){
            ((LinearLayout)(tabs.getParent())).removeView(tabs);
        }
        tabs=(TabHost)findViewById(R.id.tabhost);
        tabs.setup();
// i want to be able to call this again and again
//because it's in onResume()

and the XML:

<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android";
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
    <TabHost android:id="@+id/tabhost"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent">
        <TabWidget android:id="@android:id/tabs"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
        />
        <FrameLayout android:id="@android:id/tabcontent"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:paddingTop="62px">
        </FrameLayout>
    </TabHost>
</LinearLayout>

Basically all i want is to be able to get a fresh, new TabHost object
instead of the old one..

Thanks for the help,
Teo


On Mon, Aug 25, 2008 at 3:58 PM, 6real <[EMAIL PROTECTED]> wrote:

>
> Yes the method removeView is there for that purpose. The garbage
> collector manage the memory.
>
> Rgds,
>
>
>
> On Aug 25, 9:42 am, Teo <[EMAIL PROTECTED]> wrote:
> > Is it possible to destroy a view and recreate it? I'm looking into
> > this as a workaround for TabHost's inability to delete tabs
> > (properly).
> >
> > Thanks,
> > Teo
> >
>


-- 
Teo (a.k.a. Teodor Filimon, Teominator)
Site - www.teodorfilimon.com | Blog - www.teodorfilimon.blogspot.com
GMT +2 (or PDT +10)

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to