tabHost.setup () daje zerowy wyjątek wskaźnika (studio Android)

Mam bardzo prostą aplikację, która jest tylko działaniem z widokiem karty.

Zainicjowałem i rzuciłem wszystko tak, jak powinno być, ale ciągle otrzymuję błąd wskaźnika zerowego, który zawsze łączy się z powrotem

tabHost.setup ();

Używam studia Android i jestem nowy w Javie. To pytanie zostało zadane dużo tutaj, ale wszystkie odpowiedzi mówią tylko o włączeniu setup () i już to zrobiłem.

Oto mój plik .java:

package com.example.app;

import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.ActionBar;
import android.support.v4.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.os.Build;
import android.widget.TabHost;

public class MainActivity extends ActionBarActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    if (savedInstanceState == null) {
        getSupportFragmentManager().beginTransaction()
                .add(R.id.container, new PlaceholderFragment())
                .commit();
    }


    TabHost tabHost = (TabHost) findViewById(R.id.tabHost);
    tabHost.setup();

    TabHost.TabSpec spec1, spec2, spec3;

    spec1 = tabHost.newTabSpec("spec1");
    spec1.setContent(R.id.tab1);
    spec1.setIndicator("Tab1");
    tabHost.addTab(spec1);

    spec2 = tabHost.newTabSpec("spec2");
    spec2.setContent(R.id.tab2);
    spec2.setIndicator("Tab2");
    tabHost.addTab(spec2);

    spec3 = tabHost.newTabSpec("spec3");
    spec3.setContent(R.id.tab3);
    spec3.setIndicator("Tab3");
    tabHost.addTab(spec3);

}


@Override
public boolean onCreateOptionsMenu(Menu menu) {

    // Inflate the menu; this adds items to the action bar if it is present.
    getMenuInflater().inflate(R.menu.main, menu);
    return true;
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    // Handle action bar item clicks here. The action bar will
    // automatically handle clicks on the Home/Up button, so long
    // as you specify a parent activity in AndroidManifest.xml.
    int id = item.getItemId();
    if (id == R.id.action_settings) {
        return true;
    }
    return super.onOptionsItemSelected(item);
}

/**
 * A placeholder fragment containing a simple view.
 */
public static class PlaceholderFragment extends Fragment {

    public PlaceholderFragment() {
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
            Bundle savedInstanceState) {
        View rootView = inflater.inflate(R.layout.fragment_main, container, false);
        return rootView;
    }
}

}

Jedyną różnicą między moim kodem a niektórymi samouczkami online jest klasa publiczna MainActivity rozszerzająca się na ActionBarActivity, a nie tylko Activity. Nawet tego nie zrobiłem, to było domyślne, kiedy stworzyłem pusty projekt.

Plik XML znajduje się poniżej:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context="com.example.app.MainActivity$PlaceholderFragment">

<TabHost
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:id="@+id/tabHost"
    android:layout_alignParentTop="true"
    android:layout_alignParentRight="true"
    android:layout_alignParentEnd="true">

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

        <TabWidget
            android:id="@android:id/tabs"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"></TabWidget>

        <FrameLayout
            android:id="@android:id/tabcontent"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent">

            <LinearLayout
                android:id="@+id/tab1"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"></LinearLayout>

            <LinearLayout
                android:id="@+id/tab2"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"></LinearLayout>

            <LinearLayout
                android:id="@+id/tab3"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"></LinearLayout>
        </FrameLayout>
    </LinearLayout>
</TabHost>

questionAnswers(2)

yourAnswerToTheQuestion