I want to change the colour of searchHintIcon in SearchView
, not searching colour
Asked
Active
Viewed 705 times
1

Ritu Suman Mohanty
- 734
- 1
- 6
- 15
-
3Possible duplicate of [How to change SearchView elements' color?](https://stackoverflow.com/questions/40786189/how-to-change-searchview-elements-color) – ADM Mar 20 '18 at 14:45
-
that question is for search icon color not for searchHintIcon color @ADM – Ritu Suman Mohanty Mar 20 '18 at 14:49
-
You can use a drawable for `searchHintIcon` attribute .give it a try. – ADM Mar 20 '18 at 14:57
-
want to change the default icon color. and searchHintIcon is for api above 21 – Ritu Suman Mohanty Mar 20 '18 at 15:01
-
No sure about this but have a look at [This](https://stackoverflow.com/a/22320059/4168607) . You can then set new icon with `ColorFilter`. – ADM Mar 20 '18 at 15:19
-
@ADM its not working and giving me null pointer exception – Ritu Suman Mohanty Mar 20 '18 at 15:25
-
Try with `android.support.v7.appcompat.SearchView` And `ImageView searchIcon = (ImageView)searchView.findViewById(android.support.v7.appcompat.R.id.search_mag_icon);` .. – ADM Mar 20 '18 at 15:27
-
Already tired not working.@ADM – Ritu Suman Mohanty Mar 20 '18 at 15:34