title: Strange Error using onCreateView in PreferenceFragment when calling addPreferencesFromResource from onCreate
body: <p>I'm trying to add an ImageView to a preference fragment in order to show a preview of a color setting. I'm accessing the instance of the imageview via the onCreateView method toset the test color, and it will display. However it only works if I don't call addPreferencesFromResource in the onCreate method - which is a problem since the preferences must be added. Also if I leave the call to addPreferencesFromResource, but remove the entire onCreateView method the program will run (albiet without the updatable imageview). </p>
  
  <p>The error in both cases is "Content has view with id attribute 'android.R.id.list' that is not a ListView class"</p>
  
  <p>I have tried to access the imageview from onCreate, but by then the layout items are inflated and I can't seem to access the actual instance that is displayed.</p>
  
  <p>Error from LogCat:</p>
  
  <pre><code>04-11 00:42:43.619: E/AndroidRuntime(5362): FATAL EXCEPTION: main
  04-11 00:42:43.619: E/AndroidRuntime(5362): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.android.signalwidget/com.example.android.signalwidget.SignalWidgetConfigure}: java.lang.RuntimeException: Content has view with id attribute 'android.R.id.list' that is not a ListView class
  </code></pre>
  
  <p>Here the PreferenceActivity with inline Fragment:</p>
  
  <pre><code>public class SigConfigure extends PreferenceActivity {
  
  private static int prefs=R.xml.pref_widget_colors;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      //getFragmentManager().beginTransaction().replace(android.R.id.content, new ColorsFragment()).commit();
  
  }
  
  @Override
  public void onBuildHeaders(List&lt;Header&gt; target) {
      loadHeadersFromResource(R.xml.pref_headers, target);
  }
  
  public static class ColorsFragment extends PreferenceFragment {
  
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
  
          addPreferencesFromResource(SignalWidgetConfigure.prefs);
  
  
      }
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
  
          super.onCreateView(inflater, container, savedInstanceState);
  
          //just testing to see if the imageview can be accessed.
          View v = inflater.inflate(R.layout.layout_pref_row, container, false);
          ImageView iv = (ImageView) v.findViewById(R.id.color_preview);
          iv.setBackgroundColor(Color.CYAN);
  
          return v;
      }
  
  
  }}
  </code></pre>
  
  <p>Here is the preference definition in pref_widget_colors</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" &gt;
  
      &lt;Preference
          android:key="wifi_signal_color"
          android:title="WiFi Signal Color" &gt;
          &lt;intent
              android:action="android.intent.action.VIEW"
               android:targetClass="com.example.android.signalwidget.colorpicker.PickerActivity"
              android:targetPackage="com.example.android.signalwidget" /&gt;
      &lt;/Preference&gt;
      &lt;Preference
          android:key="cell_signal_color"
          android:title="Cell Signal Color" &gt;
          &lt;intent
              android:action="android.intent.action.VIEW"
              android:targetClass="com.example.android.signalwidget.colorpicker.PickerActivity"
              android:targetPackage="com.example.android.signalwidget" /&gt;
      &lt;/Preference&gt;
  
  &lt;/PreferenceScreen&gt;
  </code></pre>
  
  <p>Here is the layout containing the imageview in layout_pref_row.xml</p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="vertical" &gt;
  
      &lt;ImageView
          android:id="@+id/color_preview"
          android:layout_width="50dp"
          android:layout_height="50dp"
          android:layout_marginTop="5dp"
          android:background="#aaa" /&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Despite the error I am not using a ListView or a ListFragment anywhere in my project. This almost seems like an android bug. Any suggestion would be appreciated.</p>