Android Support Library ActionBar not Working in 2.3 Device Android Support Library ActionBar not Working in 2.3 Device android android

Android Support Library ActionBar not Working in 2.3 Device


I think the answer to your problem is in official developers guide:

You should declare search widget

<?xml version="1.0" encoding="utf-8"?><menu xmlns:android="http://schemas.android.com/apk/res/android"      xmlns:yourapp="http://schemas.android.com/apk/res-auto" >    <item android:id="@+id/action_search"         android:title="@string/action_search"         android:icon="@drawable/ic_action_search"         yourapp:showAsAction="ifRoom|collapseActionView"         yourapp:actionViewClass="android.support.v7.widget.SearchView" /></menu>

If you need to configure the action view (such as to add event listeners), you can do so during the onCreateOptionsMenu() callback. You can acquire the action view object by calling the static method MenuItemCompat.getActionView() and passing it the corresponding MenuItem. For example, the search widget from the above sample is acquired like this:

@Overridepublic boolean onCreateOptionsMenu(Menu menu) {    getMenuInflater().inflate(R.menu.main_activity_actions, menu);    MenuItem searchItem = menu.findItem(R.id.action_search);    SearchView searchView = (SearchView) MenuItemCompat.getActionView(searchItem); // <-- change your code to this    // Configure the search info and add any event listeners    ...    return super.onCreateOptionsMenu(menu);}