How can we change the application icon that appears on left when the SearchView widget is expanded?
Here is my onCreateOptionsMenu() code:
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_main, menu);
final TextView tv = (TextView)findViewById(R.id.textView);
SearchView searchView = (SearchView)menu.findItem(R.id.menu_search).getActionView();
searchView.setQueryHint("Search");
return super.onCreateOptionsMenu(menu);
}
And I have the following in xml for searchView widget:
<item android:id="@+id/menu_search" android:title="search"
android:showAsAction="ifRoom|collapseActionView"
android:actionViewClass="android.widget.SearchView" />
I also looked through the search_view.xml ( https://github.com/android/platform_frameworks_base/blob/master/core/res/res/layout/search_view.xml#L75 ),that is inflated by default, to check if I can get the element from there and then change the image. But I could not find any element in this xml that is responsible for collapsing the search view widget.