title: How to call findPreference from the main activity, dialog's onClick function?
body: <p>I have the following dialog in main activity:</p>
  
  <pre><code>@Override
  protected Dialog onCreateDialog(int id) {
      final Dialog dialog;
      switch(id) {
      case DIALOG_NAME:
          builderDialog.setMessage(getString(R.string.dialog_text))
                 .setCancelable(false)
                 .setPositiveButton(R.string.dialog_share_yes, new DialogInterface.OnClickListener() {
                     public void onClick(DialogInterface dialog, int id) {
                         // how should I call findPreference here?
                         PreferenceScreen screen = (PreferenceScreen) findPreference("pref_key");
                         ...
                     }
                 })
  </code></pre>
  
  <p>I am getting the following error:</p>
  
  <blockquote>
    <p>The method findPreference(String) is undefined for the type new
    DialogInterface.OnClickListener(){}</p>
  </blockquote>