title: Open EditTextPreference whenever the AlertDialog is clicked
body: <p>I have the PreferenceScreen list with </p>
  
  <p>CheckBoxPreference
       and
  EditTextPreference</p>
  
  <p>My goal is whenever the CheckBoxPreference is checked, it opens up the AlertDialog options: OK or Cancel.  If the "OK" is clicked, it is supposed to open up the 
  EditTextPreference to enter the password.</p>
  
  <p>I've been looking online and tried a lot of different ways, but I can't seem to
  find a way to open up the EditTextPreference.</p>
  
  <p>Could someone please help me out?</p>
  
  <p>This is for the live wallpaper settings....</p>
  
  <p>Thank you.</p>
  
  <p>Codes:</p>
  
  <pre><code>    if(key.equals("checkbox")) {        
          AlertDialog.Builder builder = new AlertDialog.Builder(this);
          builder.setTitle("Please Login For Privacy");
          builder.setPositiveButton("       Login      ", new DialogInterface.OnClickListener() 
          {
  
      @Override
      public void onClick(DialogInterface dialog, int which) {
  
  
     CheckBoxPreference mcheckbox2 = (CheckBoxPreference)   
     findPreference("checkbox");
     EditTextPreference editbox = (EditTextPreference) findPreference("login");
  
     mcheckbox2.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
     public boolean onPreferenceChange(Preference preference, Object newValue) {
     if(newValue.toString().equals("false")) {
          prefs.this.editbox.setEnabled(false);
      } else if(newValue.toString().equals("true")) {
          prefs.this.editbox.setEnabled(true);
      }
      return true;
  </code></pre>
  
  <p>Notice:</p>
  
  <pre><code>prefs.this.editbox.setEnabled(false);
  </code></pre>
  
  <p>or</p>
  
  <pre><code>prefs.this.editbox.setEnabled(true);
  </code></pre>
  
  <p>give me error.  It won't let me run the app :-(</p>