I want to set the text color and hint text color to the text in a android.support.v7.widget.SearchView which is not in ActionBar and not in Menu option.I have tried few ways mentioned in stackoverflow. But none of them is working.
int searchSrcTextId =getResources().getIdentifier("android:id/search_src_text", null, null);
EditText searchEditText = (EditText) searchView.findViewById(searchSrcTextId);
I would do this kind of job through the xml layout file. This can be found in the res/layout folder.
You would need to do something similar to the following:
Add this to the parent theme.
This should change the entered text.
You can also use something like this:
It will change the hint text for the SearchView.
Hope this helps :)