Valdemar Valdemar - 1 year ago 104
Android Question

How to change the default icon on the SearchView, to be use in the action bar on Android?

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="">
<item android:id="@+id/menu_search"
android:actionViewClass="android.widget.SearchView" />

Thanks in advance.

Answer Source

It looks like the actionViewClass overides the icon and it doesn't look like yuo can change it from this class.

You got two solutions :

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download