title: The getActionBar method returns null
body: <p>I'm just getting started with Android development and I'm following the tutorials by Google. I have a problem with action bars, where the getActionBar method returns null, although as per the <a href="http://developer.android.com/training/basics/actionbar/adding-buttons.html" rel="nofollow">tutorial</a> it shouldn't.
  I reviewed similar StackOverflow questions, but none of the proposed solutions works.</p>
  
  <p>Here is my onCreate code:</p>
  
  <pre><code>@Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
      getActionBar().setDisplayHomeAsUpEnabled(true);
  }
  </code></pre>
  
  <p>AndroidManifest.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.example.myfirstapp"
      android:versionCode="1"
      android:versionName="1.0" &gt;
  
      &lt;uses-sdk
          android:minSdkVersion="11"
          android:targetSdkVersion="21" /&gt;
  
      &lt;application
          android:allowBackup="true"
          android:icon="@drawable/ic_launcher"
          android:label="@string/app_name"
          android:theme="@style/AppTheme" &gt;
          &lt;activity
              android:name=".MainActivity"
              android:label="@string/app_name" &gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.MAIN" /&gt;
  
                  &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
          &lt;activity
              android:name=".DisplayMessageActivity"
              android:label="@string/title_activity_display_message"
              android:parentActivityName=".MainActivity" &gt;
              &lt;meta-data
                  android:name="android.support.PARENT_ACTIVITY"
                  android:value="com.example.myfirstapp.MainActivity" /&gt;
          &lt;/activity&gt;
      &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>
  
  <p>Any ideas?</p>
  
  <p>EDIT: adding styles.xml (it's the default one, created by Eclipse)</p>
  
  <pre><code>&lt;resources&gt;
  
      &lt;!--
          Base application theme, dependent on API level. This theme is replaced
          by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
  
      --&gt;
      &lt;style name="AppBaseTheme" parent="Theme.AppCompat.Light"&gt;
          &lt;!--
              Theme customizations available in newer API levels can go in
              res/values-vXX/styles.xml, while customizations related to
              backward-compatibility can go here.
          --&gt;
      &lt;/style&gt;
  
      &lt;!-- Application theme. --&gt;
      &lt;style name="AppTheme" parent="AppBaseTheme"&gt;
          &lt;!-- All customizations that are NOT specific to a particular API-level can go here. --&gt;
      &lt;/style&gt;
  
  &lt;/resources&gt;
  </code></pre>