The Android searchview has default queryhint textcolor and text color . How we can change the text color of edittext in Android Searchview using AndroidX
The searchView below is the reference variable of Searchview you are using .
JAVA:
EditText editText = searchView.findViewById(androidx.appcompat.R.id.search_src_text);
editText.setTextColor(Color.WHITE);
editText.setHintTextColor(Color.GRAY);
KOTLIN
val editText = searchView.findViewById(androidx.appcompat.R.id.search_src_text)
editText.setTextColor(Color.WHITE)