I have just added a SearchView
to my app, and everything is working great, however the icon is acting strangely.
This is how it is currently:
However obviously this is how I want it to look:
As you can see, I've managed to get it to appear properly by changing the last line of this:
<item
android:id="@+id/action_search"
android:icon="@android:drawable/ic_menu_search"
android:title="@string/action_search"
app:actionViewClass="android.support.v7.widget.SearchView"
app:showAsAction="always|collapseActionView" />
To this:
app:showAsAction="always" />
However, the problem with this is that when I search, the item on the left does not change to a back button like it should:
This is what I want:
Anyone have any suggestions?