Code example for EditTextPreference

Methods: setDialogTitlesetKeysetSummarysetTitle

0
        // Dialog based preferences 
        PreferenceCategory masterInfoPrefCat = new PreferenceCategory(this);
        masterInfoPrefCat.setTitle("Master Username/Password");
        root.addPreference(masterInfoPrefCat);
        //Username edit 
        editUsername = new EditTextPreference(this);
        editUsername.setDialogTitle("Username:");
        editUsername.setKey("edittext_preference");
        editUsername.setTitle("Username");
        editUsername.setSummary("Change master username");
        masterInfoPrefCat.addPreference(editUsername);
        //password edit 
        editPassword = new EditTextPreference(this);
        editPassword.setDialogTitle("Password:");
        editPassword.setKey("edittext_preference");
        editPassword.setTitle("Password");
        editPassword.setSummary("Change master password");
        masterInfoPrefCat.addPreference(editPassword);
         
        //remove master login 
Contextual code suggestions in your IDE  Get Codota for Java