java.lang.NullPointerException SearchView OnCreateOptionsMenu

Я пытаюсь заставить свое приложение работать с Gingerbread (API 10). Мое приложение вылетает, когда я нажимаю на меню со следующей ошибкой -

java.lang.NullPointerException
            at com.sample.appdemo.onCreateOptionsMenu(AppDemoListActivity.java:83)

В прошлом мое приложение отлично работало с API 11 и выше. Кто-нибудь, пожалуйста, помогите?

Вот что у меня есть:

build.gradle:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 21
    buildToolsVersion "21.1.2"
    defaultConfig {
        applicationId "com.sample.appdemo"
        minSdkVersion 8
        targetSdkVersion 19
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
    productFlavors {
    }
}

dependencies {
    compile project(':poi-3.10-FINAL-20140208')
    compile 'com.android.support:appcompat-v7:21.0.3'
}

AppDemoListActivity.java

    package ...;
    import android.app.SearchManager;
    import android.support.v4.app.FragmentActivity;
    import android.support.v4.app.FragmentTransaction;
    import android.support.v4.view.MenuItemCompat;
    import android.support.v7.widget.SearchView;
    import ...;

    @Override
        public boolean onCreateOptionsMenu(Menu menu) {
            // Inflate the menu; this adds items to the action bar if it is present.
            MenuInflater inflater = getMenuInflater();
            inflater.inflate(R.menu.action_bar_search_optionsmenu, menu);
            SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE);

        MenuItem searchItem = menu.findItem(R.id.action_search);
        SearchView searchView = (SearchView) MenuItemCompat.getActionView(searchItem);

        ComponentName cn = new ComponentName(this, SearchActivity.class);
        searchView.setSearchableInfo(
                searchManager.getSearchableInfo(cn)
        );

        return super.onCreateOptionsMenu(menu);
    }

action_bar_search_menu:

<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto">

    <item android:id="@+id/action_search"
        android:icon="@drawable/ic_action_search"
        android:title="@string/action_search"
        app:showAsAction="always"
        app:actionViewClass="android.support.v7.widget.SearchView"/>
</menu>

Обновление № 1:

Манифест:

<activity
    android:name=".SearchActivity"
    android:label="@string/title_activity_search"
    android:parentActivityName=".AppDemoListActivity" >

    <!-- This intent-filter identifies this activity as "searchable" -->

    <intent-filter>
        <action android:name="android.intent.action.SEARCH" />

        <category android:name="android.intent.category.DEFAULT" />
    </intent-filter>

    <!-- This metadata entry provides further configuration details for searches -->
    <!-- that are handled by this activity. -->

    <meta-data
        android:name="android.app.searchable"
        android:resource="@xml/searchable" />
</activity>

comment
Что такое строка 83 из AppDemoListActivity.java?   -  person CommonsWare    schedule 27.02.2015
comment
Строка 83: searchView.setSearchableInfo(searchManager.getSearchableInfo(cn));   -  person sunskin    schedule 27.02.2015
comment
А SearchActivity.class уже существует и прописан в вашем манифесте???   -  person HCarrasko    schedule 27.02.2015
comment
да. Я добавлю обновление с манифестом   -  person sunskin    schedule 27.02.2015
comment
Возможный дубликат stackoverflow.com/q/11276043/4193263   -  person ByteHamster    schedule 27.02.2015
comment
ByteHamster: я наткнулся на этот пост, но, к сожалению, исправление, которое у меня уже есть в коде, не сработало :(   -  person sunskin    schedule 27.02.2015
comment
кто-нибудь может помочь?   -  person sunskin    schedule 28.02.2015