title: Custom ArrayAdapter in a ListFragment
body: <p>I'm trying to create a custom <code>ArrayAdapter</code> to use for my <code>ListFragment</code>.  Right now nothing is being displayed in the <code>ListFragment</code> except for the <code>TextView</code> saying what Fragment number it is.  I have put a breakpoint in <code>getView()</code> method of my adapter and it is not being called.  I searched for reasons that wouldn't be called and some people seem to think that my ListView is hidden, so I've tried changing the <code>layout_height</code> to <code>wrap_content</code>, but that didn't work.</p>
  
  <p>Also, I've been following the code from this developer's page: <a href="http://developer.android.com/reference/android/support/v4/app/FragmentPagerAdapter.html" rel="noreferrer">http://developer.android.com/reference/android/support/v4/app/FragmentPagerAdapter.html</a></p>
  
  <p>ListFragment:</p>
  
  <pre><code>public class HomeFragment extends ListFragment implements FragmentTitle
  {
  private int mNum = 0;
  private String mTitle = "Home";
  private ListView mListView;
  private MyArrayAdapter mAdapter;
  
  @Override
  public void onCreate(Bundle savedInstanceState) 
  {
      super.onCreate(savedInstanceState);
      mNum = getArguments() != null ? getArguments().getInt("num") : 1;
      InfoContainer temp = new InfoContainer("test1", "test2");
      mAdapter = new MyArrayAdapter(getActivity(), android.R.id.list, temp);
  }
  
  @Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) 
  {
      View v1 = inflater.inflate(R.layout.fragment_pager_list, container, false);
      TextView tv = (TextView) v1.findViewById(R.id.text);
      tv.setText("Fragment #" + mNum);
      mListView = (ListView) v1.findViewById(android.R.id.list);
      return v1;
  }
  
  @Override
  public void onActivityCreated(Bundle savedInstanceState) 
  {
      super.onActivityCreated(savedInstanceState);
      mListView.setAdapter(mAdapter);
  }
  
  @Override
  public void onListItemClick(ListView l, View v, int position, long id) 
  {
      Log.i("HomeFragment", "Item clicked: " + id);
  }
  
  public CharSequence getTitle() 
  {
      return mTitle;
  }
  
  }
  </code></pre>
  
  <p>ArrayAdapter:</p>
  
  <pre><code>public class MyArrayAdapter extends ArrayAdapter&lt;InfoContainer&gt;
  {
  Context mContext;
  InfoContainer data;
  
  public MyArrayAdapter(Context context, int textViewResourceId, InfoContainer temp) 
  {
      super(context, textViewResourceId);
      mContext = context;
      this.data = temp;
  }
  
  @Override
  public View getView(int position, View convertView, ViewGroup parent)
  {
      View row = convertView;
      ViewHolder holder = new ViewHolder();
  
      if(row == null)
      {
          LayoutInflater inflater = ((Activity)mContext).getLayoutInflater();
          row = inflater.inflate(R.id.pager, parent, false);
          holder.v1 = (TextView) row.findViewById(R.id.listview_name);
          holder.v2 = (TextView) row.findViewById(R.id.listview_data);
          row.setTag(holder);
      }
      else
      {
          holder = (ViewHolder) row.getTag();
      }
      InfoContainer info = data;
      holder.v1.setText(info.name);
      holder.v2.setText(info.text);
      return row;
  }
  
  public static class ViewHolder
  {
      TextView v1;
      TextView v2;
  }
  
  }
  </code></pre>
  
  <p>fragment_pager_list.xml:</p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:orientation="vertical"
  android:background="#000000" &gt;
  
  &lt;TextView
      android:id="@+id/text"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:gravity="center_vertical|center_horizontal"
      android:text="@string/hello_world"
      android:textAppearance="?android:attr/textAppearanceMedium"
      android:textColor="#FFFFFF" /&gt;
  
      &lt;ListView
          android:id="@android:id/list"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:drawSelectorOnTop="false"
          android:background="@drawable/listview_background"
          android:textColor="#FFFFFF" /&gt;
  </code></pre>
  
  <p></p>
  
  <p>I've made custom ArrayAdapters before with no problem, so is there something I'm missing about getting them to work with a ListFragment?</p>