title: save custom values to preference in android?
body: <p>I have a preference settings for which i have configured a dialog box pop up on click of preference using the below code.</p>
  
  <pre><code>Dialog passwordDialog = new Dialog(this);
  passwordDialog.setContentView(R.layout.password_dialog);
  passwordDialog.setTitle("Set new password.");
  passwordDialog.setCancelable(true);
  passwordDialog.show();
  </code></pre>
  
  <p>The dialog is coming fine. However In the dialog i have a password edit text and a confirm password edit text. If these matches with each other i need to save the password to preference. I do not know how to save the value to a preference on ok click in my custom dialog. Please let me know how to do this. Thank you for your time and help.</p>