All I want is for the Icon to appear in the Search MenuItem in my application and expand when clicked. Note that this is a snippet using v7 appCompat version 20. +. I have minSDKVersion 14, target 19, compiled version 19.
Here is my menu information.
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
tools:context="com.test.testapp.fragment.LibraryFragment">
<item
android:id="@+id/action_search"
android:title="@string/action_search"
app:icon="@drawable/ic_action_search"
app:showAsAction="ifRoom|collapseActionView"
app:actionViewClass="android.support.v7.widget.SearchView"
android:actionViewClass="android.support.v7.widget.SearchView"
/>
</menu>
However, every time I launch the application, I see that the button displays as “SEARCH” (title text), and not an icon! Any ideas?
source
share