title: java.lang.IllegalStateException: Content view not yet created
body: <p>The "<strong>mMatchAdapter</strong>" is initialize at onCreate, but it is null in "<strong>setCursor</strong>", why?
  This ListFragment is a tab of a tabHost, I use it to display list. I want change adapter in setCursor to display other list, but occur an error at line <code>mMatchAdapter.changeCursor(c);</code>
  because mMatchAdapter is null, why? when getListView above this line, will </p>
  
  <pre><code>public class RecentsListFragment extends ListFragment implements onSetRecentsContactsCursor {
      public final static String TAG = "RecentsListFragment";
  @Override
  public void onViewCreated(View view, Bundle savedInstanceState) {
      // TODO Auto-generated method stub
      Log.d(TAG, "---------&gt; onViewCreated ");
      mListView = getListView();
      Log.d(TAG, "onViewCreated------mListView = " + mListView);
      mViewCreated = true;
      setListShown(false);
      super.onViewCreated(view, savedInstanceState);
  }
  
  @Override
  public void onDestroyView() {
      // TODO Auto-generated method stub
      Log.d(TAG, "---------&gt; onDestroyView ");
      mViewCreated = false;
      super.onDestroyView();
  }
  
  
  @Override
  public void onListItemClick(ListView l, View v, int pos, long id) {
      // TODO Auto-generated method stub
      Cursor cursor;
      ListAdapter adapter = getListAdapter();
      if (adapter == mLogsAdapter){
          cursor = (Cursor)mLogsAdapter.getItem(pos);
      }else if (adapter == mMatchAdapter){
          cursor = (Cursor)mMatchAdapter.getItem(pos);
      }
      super.onListItemClick(l, v, pos, id);
  }
  
  
  @Override
  public void onAttach(Activity activity) {
      // TODO Auto-generated method stub
      Log.d(TAG, "------&gt;onAttach");
      mActivity = activity;
      super.onAttach(activity);
  }
  
  
  @Override
  public void onCreate(Bundle savedInstanceState) {
      // TODO Auto-generated method stub
      Log.d(TAG, "---------&gt; onCreate ");
  
      mNumberQuery = NumberLocalQuery.getInstance(mActivity.getApplicationContext());
      mQueryHandler = new CursorQueryHandler(mActivity.getContentResolver());
      mPhotoLoader = new ContactPhotoLoader(mActivity);
      mLogsAdapter = new BBKRecentCallsAdapter(mActivity, mPhotoLoader, mNumberQuery);
  
      mMatchAdapter = new BBKDialerMatchListAdapter(mActivity, mPhotoLoader, mNumberQuery);
      super.onCreate(savedInstanceState);
  }
  
  @Override
  public void onStart() {
      // TODO Auto-generated method stub
      mCallsChanged = true;
      Log.d(TAG, "---------&gt; onStart ");
      setListAdapter(mLogsAdapter);
      mLogsAdapter.clearCache();
      startQuery();
      super.onStart();
  }
  
  
  @Override
  public void onStop() {
      // TODO Auto-generated method stub
      mCallsChanged = false;
      Log.d(TAG, "---------&gt; onStop ");
  
      if (null != mQueryHandler){
          mQueryHandler.cancelOperation(CUROSR_QUERY_TOKEN_CALLS);
      }
      super.onStop();
  }
  
  
  @Override
  public void onResume() {
      // TODO Auto-generated method stub
      Log.d(TAG, "---------&gt; onResume ");
      boolean is24Hour = DateFormat.is24HourFormat(mActivity);
      if (null != mLogsAdapter){
          mLogsAdapter.set24Hour(is24Hour);
      }
      if (null != mMatchAdapter){
          mMatchAdapter.set24Hour(is24Hour);
      }
      mIsMatching = false;
      super.onResume();
  }
  
  
  private void startQuery() {
      Log.d(TAG, "---------&gt; startQuery ");
      if(mCallsChanged) {
          Log.d(TAG, "start query call_log database");
          mCallsChanged = false;
          mQueryHandler.cancelOperation(CUROSR_QUERY_TOKEN_CALLS);
  
          mQueryHandler.startQuery(CUROSR_QUERY_TOKEN_CALLS, null,
                  Calls.CONTENT_URI, RecentCallsListActivity.CALL_LOG_PROJECTION, null,
                  null, Calls.DEFAULT_SORT_ORDER);
      }else if(mLogsAdapter != null &amp;&amp; (mLogsAdapter.getCursor() != null)) {
          mLogsAdapter.notifyDataSetChanged();
      }
  }
  
  @Override
  public void onActivityCreated(Bundle savedInstanceState) {
      // TODO Auto-generated method stub
      Log.d(TAG, "---------&gt; onActivityCreated ");
      super.onActivityCreated(savedInstanceState);
  }
  
  @Override
  public void onDestroy() {
      // TODO Auto-generated method stub
      Log.d(TAG, "---------&gt; onDestroy ");
      if (null != mLogsAdapter){
          mLogsAdapter.clearCache();
          mLogsAdapter.changeCursor(null);
      }
      if (null != mMatchAdapter){
          mMatchAdapter.changeCursor(null);
      }
      super.onDestroy();
  }
  
  @Override
  public void onDetach() {
      // TODO Auto-generated method stub
      Log.d(TAG, "---------&gt; onDetach ");
      super.onDetach();
  }
  
  @Override
  public void setCursor(Cursor c) {
      // TODO Auto-generated method stub
      Log.d(TAG, "====setCursor======mViewCreated====" + mViewCreated);
      Log.d(TAG, "---------&gt;mListView = " + mListView);
      if (null != c &amp;&amp; c.getCount() &gt; 0){
          setListAdapter(mMatchAdapter);
      }
      mMatchAdapter.changeCursor(c);
  }
  }
  </code></pre>