lumoss lumoss - 8 months ago 78
Android Question

Android EditTextPreference disable Dialog

I want to disable(not show) the Dialog, when i click the EditTextPreference in a Preference Activity.

When i click the EditTextPreference, a pop up dialog show. Now i want to disable this. I try set an onclicklistener, but the dialog show same.

public class Settings extends PreferenceActivity {

public void onCreate(Bundle savedInstanceState) {
EditTextPreference userName=(EditTextPreference) findPreference("prefUsername");
userName.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
public boolean onPreferenceClick(Preference preference) {

return false;
}); ...

I try add this to the EditTextPreference: android:clickable="false", but nothing.

Answer Source

Disable it.



in XML. Or to disable in runtime,


Actually, if you do not want a dialog, you probably should use simple Preference instead of EditTextPreference.