Since a private SearchView
class method is setting submit_area
Visibility.Gone
so we can't do much about it.
A quick dirty trick is to set of the default buttons enabled and then set its width and height to 0. Setting Visibility
didn't work so have to set height/width.
I enabled search button and then set its height/width to zero.
int submit_areaId = searchView.getContext().getResources().getIdentifier("android:id/submit_area", null, null);
ImageView submitImage = (ImageView) searchView.findViewById(search_go_btnId);
searchView.setSubmitButtonEnabled(true);
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(0, 0);
submitImage.setLayoutParams(layoutParams);
Now SearchView will show anything that you add in submit_area.