I had the same problem because in my menu I used:
android:actionViewClass="android.widget.SearchView"
as per the google documentation.
Well it turns out that if I’m using AppCompatActivity I should use
app:actionViewClass="android.widget.SearchView"
instead.
Hope this helps someone.
More Related Contents:
- ViewPager.setOffscreenPageLimit(0) doesn’t work as expected
- Android Studio keeps refusing to resolve com.android.support:appcompat-v7:29.0.1
- Android Support Repo 46.0.0 with Android Studio 2.3
- How to make ConstraintLayout work with percentage values?
- No ActionBar in PreferenceActivity after upgrade to Support Library v21
- Using android vector Drawables on pre Lollipop crash
- Is there any reason to use the support.v4 library in Android?
- How can I access getSupportFragmentManager() in a fragment?
- How to add Action Bar from support library into PreferenceActivity?
- Need to disable expand on CollapsingToolbarLayout for certain fragments
- The import android.support.v7.app cannot be resolved
- add ‘tools:replace=”Android:value”‘ to element at AndroidManifest
- No resource found that matches the given name: attr ‘android:keyboardNavigationCluster’. when updating to Support Library 26.0.0
- Status bar turns white and does not show content behind it
- Android support library error after updating to 23.3.0
- Fragment must be a public static class to be properly recreated from instance state
- Remove line break in TabLayout
- How do I make DrawerLayout to display below the Toolbar?
- Android support library setup with maven
- Up navigation broken on JellyBean?
- Android error – Caused by: java.lang.NoClassDefFoundError: android.support.v4.util.SparseArrayCompat
- Error “package android.support.v7.app does not exist”
- Android v21 Theme.Appcompat color accent is ignored, no padding on dialogs
- Duplicate zip entry [classes.jar:android/support/design/widget/CoordinatorLayout$Behavior.class]
- Fixing Error in styles.xml to generate R.java : No resource found name ‘Theme.AppCompat.Light’
- RequiresApi vs TargetApi android annotations
- Android : Control Smooth scroll over recycler view
- Facebook SDK for Android duplicate support library on dependencies
- FragmentStatePagerAdapter with ChildFragmentManager – FragmentManagerImpl.getFragment results in NullPointerException
- NullPointerException: with ActionBar.setDisplayHomeAsUpEnabled(boolean)’ on a null object reference