title: Adding different types of items a list view
body: <p>Is there a good tutorial or link that shows how to add different items to a listview?<br>
  For example, one with two <strong>Text lines</strong> and a <strong>Check box</strong>, another that you just press and and something would pop up. All I have now is every list item is the same two line text view and checkbox...<br>
  <strong>Or</strong>, if there is a way to add 1 row at a time with a different layout through <code>R.layout.xxx</code>?</p>
  
  <pre><code>public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
      mRoot = inflater.inflate(R.layout.frag_settings, container, false);
      mItems = getResources().getStringArray(R.array.setting_items);
      mItemDescription = getResources().getStringArray(R.array.setting_item_descriptions);
  
  mItemListView = (ListView) mRoot.findViewById(R.id.lvMainListView);
  
  ArrayAdapter&lt;String&gt; lvRowTitle = new ArrayAdapter&lt;String&gt;(getActivity(), 
           R.layout.setting_twolinetext_checkbox, R.id.tvRowTitle,
          mItems);
  
  mItemListView.setAdapter(lvRowTitle);
  
  
  ArrayAdapter&lt;String&gt; lvRowDesc = new ArrayAdapter&lt;String&gt;(getActivity(), 
          R.layout.setting_twolinetext_checkbox, R.id.tvRowDesc,
          mItemDescription);
  
  
     mItemListView.setAdapter(lvRowDesc);
  
  
  return mRoot;
  </code></pre>