I am creating a searchview in the toolbar using onCreateOptionsMenu
, but can\'t get the clear X
button to initially be white. It becomes white when
Found a solution. However, interested in better ones.
Downloaded the "clear button" image from https://www.google.com/design/icons/#ic_clear in 24pt white and added this code to the end of onCreateOptionsMenu
// Does help!
ImageView searchClose = (ImageView) searchView.findViewById(android.support.v7.appcompat.R.id.search_close_btn);
searchClose.setImageResource(R.drawable.ic_clear_white_24dp);