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
You can also set it from XML. I'm using the support library 24.2.1 and an activity with a theme whose parent is "Theme.AppCompat.Light" and an android.support.v7.widget.SearchView in the ActionBar.
You can set an actionBarWidgetTheme in your activity theme like this:
And then define MyActionBarWidgetTheme and set the colours you want there:
android:textColorSecondary applies to the close icon
android:textColorPrimary applies to the text you enter
colorControlActivated applies to the cursor
android:textColorHint applies to the hint text