title: How to open or simulate a click on an android Preference, created with XML, programmatically?
body: <p>I've an android application with preferences declared in XML, loaded with <code>addPreferencesFromResource</code>. The user can open preferences, click on each item and edit them, all works.</p>
  
  <p>One preference I have is:</p>
  
  <pre><code>        &lt;ListPreference android:key="abc"
              android:title="@string/abc"
              android:summary="@string/cde"
              android:persistent="true"/&gt;
  </code></pre>
  
  <p>How can I show the preference dialog to a user automatically (without the need for the user to go to the preference screen and click on it?).</p>
  
  <p>I tried <code>( (android.preference.DialogPreference) prefMgr.findPreference( "abc" )).showDialog(null)</code>, but is says it is a protected method...? Called it from my main activity (which is a <code>PreferenceActivity</code>), that's why it obviously cannot work. But how else?</p>
  
  <p>EDIT</p>
  
  <p>I just found two threads (<a href="https://groups.google.com/group/android-developers/browse_thread/thread/3b38965a44525190" rel="noreferrer">1</a>, and <a href="https://groups.google.com/group/android-developers/browse_thread/thread/6ee893906962e821" rel="noreferrer">2</a>) with the idea to use <code>findViewById</code> to access the preference, but with no success. It always returns <em>null</em> (does for me, too).</p>
  
  <p>It looks like there is really no possibility to do this from code.</p>