title: Non Deprecated findPreference() Method? - Android
body: <p>I want to detect when a <code>Preference</code> contained in a <code>ListView</code> gets clicked, so that I can launch an intent to manage that selection.</p>
  <p>I would have done like this in my layout <code>XML</code> file:</p>
  <pre><code>&lt;Preference android:title=&quot;About&quot; android:key=&quot;myKey&quot;&gt;&lt;/Preference&gt;
  </code></pre>
  <p>And the following in my <code>java</code> code:</p>
  <pre><code>Preference myPref = (Preference) findPreference(&quot;myKey&quot;);
  myPref.setOnPreferenceClickListener(new OnPreferenceClickListener() {
               public boolean onPreferenceClick(Preference preference) {
                   //open browser or intent here
               }
           });
  </code></pre>
  <p>But the method <a href="http://developer.android.com/reference/android/preference/PreferenceGroup.html#findPreference%28java.lang.CharSequence%29" rel="nofollow noreferrer"><code>public Preference findPreference (CharSequence key)</code></a> is deprecated.</p>
  <ol>
  <li>Is there a non deprecated equivalent?</li>
  <li>If not, what if I use it anyway?</li>
  <li>How can <code>Fragments</code> help me do my task in a better way? Check here: <a href="https://stackoverflow.com/questions/6503496/preferences-without-deprecated-methods">Preferences without deprecated methods</a>.</li>
  </ol>
  <hr />
  <p>Here you can check the <code>XML</code> layout structure that my activity has, and a snapshot of the application:</p>
  <p><strong>XML:</strong></p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;PreferenceScreen xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot; &gt;
  
      &lt;Preference
          android:key=&quot;about&quot;
          android:title=&quot;@string/titleAbout&quot;
          android:summary=&quot;@string/summaryAbout&quot;
      /&gt;
  
      &lt;Preference
          android:key=&quot;labelTaxonomy&quot;
          android:title=&quot;@string/titleLabelTaxonomy&quot;
          android:summary=&quot;@string/summaryLabelTaxonomy&quot;
      /&gt;
  
  &lt;/PreferenceScreen&gt;
  </code></pre>
  <p><strong>SNAPSHOT:</strong></p>
  <p><img src="https://i.stack.imgur.com/f2Y20.png" alt="snapshopt" /></p>
  <p>After clicking on the About (or Access Label Taxonomy) <code>Preference</code>, I'd like to open an <code>intent</code> of some kind (could also be a video or anything else...the names are misleading).</p>