In my application I am using EditTextPreference to request the user to enter an IP address, but in the XML file the initial value is defaultValue="192.168.1.0" and it has a light blue background as you can see in the image, I need to change the color only of this initial text and the background, can someone tell me how to do it in the XML?
<EditTextPreference
android:defaultValue="192.168.1.0"
android:digits="0123456789."
android:inputType="number|numberDecimal"
android:key="example_text"
android:maxLines="1"
android:selectAllOnFocus="true"
android:singleLine="true"
android:title="IP Address" />
To change the color when selecting the content of the
EditText
oEditTextPreference
use the propertyandroid:textColorHighlight
and define the desired color:To change the color of the text use the property
android:textColor
:According to the previous example, the color when selecting the text is green and the color of the text would be blue: