Sorry for maybe a stupid question.
I have EditTextPreference… How to check is his text empty or not ?
public void onSharedPreferenceChanged(SharedPreferences sharedPreference,
String key) {
String editorText= (editTextPreference.getText()).trim();
if (editorText== "") {
editorText.setText("Something");
}
}
That’s not work….
You should also check for null.
try it: