I want to change the default search icon of searchview. I have tried the below things :
int searchImgId = getResources().getIdentifier("android:id/search_mag_icon", null, null);
ImageView searchIconView = (ImageView) mSearchView.findViewById(searchImgId);
if(searchIconView != null){
searchIconView.setImageResource(R.drawable.ic_clear_white);
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(
ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.MATCH_PARENT);
searchIconView.setLayoutParams(layoutParams);
But It is not changing the search icon at all, how can I do this. I have checked other links also and tried the solutions given but that also not working in my case.
How to change the default icon on the SearchView, to be use in the action bar on Android?
Please help if anyone have idea here.