title: Get event on dialog( Ok ,Cancel) button pressed(Android)
body: <p>In my Android application I am displaying the dialogbox which contains <code>edittext</code>. This dialogbox is displayed using <code>PreferenceCategory</code>.My <code>xml</code> file looks like</p>
  
  <pre><code>&lt;PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" &gt;
  
      &lt;PreferenceCategory android:title="@string/security_setting_edittext_hint" &gt;
          &lt;EditTextPreference
          android:dialogTitle="@string/security_setting_button"
          android:key="set_password_preference"
          android:summary="@string/set_password_summary"
          android:title="@string/security_setting_button"
          android:inputType="number"
          android:icon="@drawable/lock"
           /&gt;
      &lt;/PreferenceCategory&gt;
  
  &lt;/PreferenceScreen&gt;
  </code></pre>
  
  <p>My Java file looks like </p>
  
  <pre><code>public class Settings extends PreferenceActivity {
  
      Dialog setPasswordDialog;
      EditText setPassword;
      EditTextPreference editPreference;
  
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          this.setTitle("Settings");
          addPreferencesFromResource(R.xml.preference_authentication);
          editPreference=(EditTextPreference)   findPreference("set_password_preference");
  
  }
  </code></pre>
  
  <p>There is no issue in displaying the <code>dialog</code> but now i want tho get event when Ok and Cancel button from dialog box is pressed to do something.
  Please provide me solution.</p>