Note that there are some explanatory texts on larger screens.

plurals
  1. POnot able to display tabhost inside fragment android
    primarykey
    data
    text
    <p>i am creating a TabHost inside fragment. i am having 2 fragments in my fragmentActivity and i want the tabhost in my right fragment. but TabHost is not displaying and the activity is forced closed giving nullpointerexception</p> <p>this is the code in my fragment where i am calling TabHost</p> <pre><code>public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.menucat, container, false); mTabHost=(TabHost)getView().findViewById(android.R.id.tabhost); TabHost.TabSpec spec; mTabHost.setup(); intent=new Intent(getActivity(),Activity1.class); spec = mTabHost.newTabSpec("soups").setIndicator("Soups").setContent(intent); mTabHost.addTab(spec); mTabHost.setCurrentTab(0); return view; } </code></pre> <p>this is my layout which i am using to create tabhost.</p> <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical"&gt; &lt;TabHost xmlns:android="http://schemas.android.com/apk/res/android" android:id="@android:id/tabhost" android:layout_width="fill_parent" android:layout_height="fill_parent"&gt; &lt;LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"&gt; &lt;TabWidget android:id="@android:id/tabs" android:visibility="gone" android:layout_width="fill_parent" android:layout_height="wrap_content"/&gt; &lt;FrameLayout android:id="@android:id/tabcontent" android:layout_width="fill_parent" android:layout_height="fill_parent"/&gt; &lt;/LinearLayout&gt; &lt;/TabHost&gt; </code></pre> <p></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload