Hey... i'm trying to create an activity with the layout structure like this:
<?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"
>
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TabWidget android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@android:id/tabs"
/>
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
</FrameLayout>
</LinearLayout>
</TabHost>
<some code here>
</LinearLayout>
What is wrong here? I'm getting nullPointerException in my activity
public class TabsActivity extends Activity
{
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.tabs);
// Resources res = getResources();
// TabHost tabHost = (TabHost)findViewById(R.id.tabHost);
}
}
The problem is with nesting. There is no problem with the TabHost as the main XML node. Thx!
Error: