ActionBar nullpointerException
<p>I want to use ActionBarSherlock with my app. When I call <code>getSupportActionBar()</code> I get a <code>NullPointerException</code>; I already imported the ActionBarSherlock library into my project.</p>

<p>Here is my Java class:</p>

<pre><code>public class ProfileActivity extends SherlockActivity  {


    @Override
            public boolean onCreateOptionsMenu(com.actionbarsherlock.view.Menu menu) {
                com.actionbarsherlock.view.MenuInflater inflater = this.getSupportMenuInflater();
                inflater.inflate(R.menu.mainmenu, menu);
                return true;
            }

        public void onCreate(Bundle savedInstanceState) {
                super.onCreate(savedInstanceState);

                getWindow().requestFeature(Window.FEATURE_ACTION_BAR);

                setContentView(R.layout.profile_page);



                getSupportActionBar().setTitle("Example!");  //nullpointerException


              }
        }

}
</code></pre>

<p>And my manifest file:</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.sal"
    android:versionCode="1"
    android:versionName="1.0" &gt;

    &lt;uses-feature
        android:glEsVersion="0x00020000"
        android:required="true"/&gt;



    &lt;uses-sdk
        android:minSdkVersion="11"
        android:targetSdkVersion="10" /&gt;
    &lt;uses-permission android:name="android.permission.INTERNET"/&gt;
    &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/&gt;
    &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/&gt;
    &lt;uses-permission android:name="android.permission.CAMERA"/&gt;

    &lt;permission
        android:name="com.vogella.android.locationapi.maps.permission.MAPS_RECEIVE"
        android:protectionLevel="signature" /&gt;

    &lt;uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/&gt;
    &lt;!-- The following two permissions are not required to use
     Google Maps Android API v2, but are recommended. --&gt;
    &lt;uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/&gt;
    &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/&gt;
        &lt;uses-permission android:name="com.example.sal.permission.MAPS_RECEIVE"/&gt;
        &lt;uses-permission android:name="android.permission.READ_PHONE_STATE"/&gt;




    &lt;application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" 
        android:name=".FriendPickerApplication"&gt;



        &lt;activity
            android:name="com.example.sal.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;!--  Entry for RegisterActivity.class --&gt;
        &lt;activity android:name=".RegisterActivity"
                  android:label="Register New Account"&gt;&lt;/activity&gt;
        &lt;meta-data android:value="@string/app_id" android:name="com.facebook.sdk.ApplicationId"/&gt;
        &lt;activity android:label="@string/app_name" android:name="com.facebook.LoginActivity"&gt;&lt;/activity&gt;
        &lt;activity android:name=".ProfileActivity" android:label="Profile page"&gt;&lt;/activity&gt;

        &lt;meta-data
              android:name="com.google.android.maps.v2.API_KEY"
              android:value="AIzaSyDTVRXMTmfe3jZyAlt-87kRgqM8y4TzIto"/&gt;


        &lt;activity android:name="SaleMapActivity"&gt;&lt;/activity&gt;
        &lt;activity android:name="GroupMapActivity"&gt;&lt;/activity&gt;
        &lt;activity android:name="DeliverMapActivity"&gt;&lt;/activity&gt;
        &lt;activity android:name="PickFriendsActivity"&gt;&lt;/activity&gt;
        &lt;activity android:name="TabMainActivity"&gt;&lt;/activity&gt;
        &lt;activity android:name="itemSaleActivity"&gt;&lt;/activity&gt;
        &lt;activity android:name="FreindsActivity"&gt;&lt;/activity&gt;
        &lt;activity android:name="ExitActivity"&gt;&lt;/activity&gt;
        &lt;activity android:name="OneTimeDetailesScreen"&gt;&lt;/activity&gt;

    &lt;/application&gt;

&lt;/manifest&gt;
</code></pre>

<p>Thanks.</p>

<p>and this is my style:</p>

<pre><code>&lt;style name="AppTheme" parent="Theme.Sherlock.Light"&gt;
        &lt;item name="android:windowActionBar"&gt;true&lt;/item&gt;
    &lt;/style&gt;
</code></pre>

<p>adn here is the logcat:</p>

<pre><code>03-24 16:20:24.325: E/AndroidRuntime(1927): Caused by: java.lang.NullPointerException
03-24 16:20:24.325: E/AndroidRuntime(1927):     at com.example.sal.ProfileActivity.onCreate(ProfileActivity.java:349)
03-24 16:20:24.325: E/AndroidRuntime(1927):     at android.app.Activity.performCreate(Activity.java:5104)
03-24 16:20:24.325: E/AndroidRuntime(1927):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
03-24 16:20:24.325: E/AndroidRuntime(1927):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
03-24 16:20:24.325: E/AndroidRuntime(1927):     ... 23 more
</code></pre>
