How to change the default icon on the SearchView, to be use in the action bar on Android?
android, android-actionbar
Solution
It looks like the actionViewClass overides the icon and it doesn't look like you can change it from this class.
You got two solutions:
- Live with it and I think it's the best option in terms of user experience and platform conformity.
- Define your own actionViewClass
Problem
I'm having a bit of trouble customizing the search icon in the SearchView. On my point of view, the icon can be changed in the Item attributes, right? Just check the code bellow.. Can someone tell me what I'm doing wrong? This is the menu I'm using, with my custom search icon icn_lupa. But when I run the app, I always get the default search icon... ``` <menu xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@+id/menu_search" android:title="@string/menu_search" android:icon="@drawable/icn_lupa" android:showAsAction="always" android:actionViewClass="android.widget.SearchView" /> </menu> ```