Skip to content
Advertisement

Tag: searchview

Show/hide Searchview using onOptionsItemSelected

I want to make my Searchview to be visible only when I open product option from the drawer, to do that I am trying using onOptionsItemSelected method to listen which options is being used. The problem is I am always get a NullPointerException everytime I tried to get my SearchView id from onOptionsItemSelected. I knew how to hide the SearchView

SearchView icon shows twice

I’ve implemented SearchView inside my toolbar, following Android’s official instructions. SearchView works well itself, but when I tap the search icon, it is shifted to the left instead of showing the Search Hint and Close button, although if I click this “second Search” icon, finally I get the typical search view. Here is my xml of the toolbar: And my

Advertisement