Hesam
Hesam

Reputation: 53600

How to get android:id="@android:id/tabhost" in activity

I have following xml file:

<android.support.v4.app.FragmentTabHost 
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@android:id/tabhost"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_alignParentTop="true">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical" >

        <FrameLayout
            android:id="@android:id/tabcontent"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_marginTop="50dp"/>
    </LinearLayout>

</android.support.v4.app.FragmentTabHost>

I'm using Android SlidingUpPanel library. There is mPanelLayout.setDragView(this.findViewById(R.id.???)); that I should set it with id of tab host.

I could set it like mPanelLayout.setDragView(this.findViewById(R.id.tabhost)); if I set it in xml like android:id="@+id/tabhost". However, I have no idea how to get android:id="@android:id/tabhost" in my activity.

Any suggestion would be appreciated. Thanks.

Upvotes: 0

Views: 718

Answers (3)

user3898539
user3898539

Reputation:

just try one of these

TabHost tabHost = getTabHost();

or

TabHost tabHost= (TabHost)view.findViewById(android.R.id.tabhost)

Upvotes: 0

Simon Marquis
Simon Marquis

Reputation: 7516

Since this resource comes from the Android framework (@android)
so, you have to get it this way:

mPanelLayout.setDragView(this.findViewById(android.R.id.tabhost));

Upvotes: 2

Santosh Dhoundiyal
Santosh Dhoundiyal

Reputation: 588

try this

mPanelLayout.setDragView(getView().findViewById(android.R.id.tabhost));

Upvotes: 0

Related Questions