title: How to add icons to Preference
body: <p>I'm making an app that extends the PreferenceActivity and I want to add an icon to each Preference.</p>
  
  <p>I read a similar question, and this is the answer with more reputation:</p>
  
  <p><strong>CommonsWare Say:</strong></p>
  
  <blockquote>
    <p>The Settings application uses a private custom PreferenceScreen subclass to have the icon -- IconPreferenceScreen. It is 51 lines of code, including the comments, though it also requires some custom attributes. The simplest option is to clone all of that into your project, even though you do not like that.</p>
  </blockquote>
  
  <p>But I can't make it work. For now I cloned the class IconPreferenceScreen to my project. And I don't know what I have to do after this. I'm trying to make a new IconPreferenceScreen I can't make it work..</p>
  
  <pre><code>    IconPreferenceScreen test = new IconPreferenceScreen();
      test.setIcon(icon);
  </code></pre>