title: Swapping a cursor with SimpleAdapterCursor swapCursor()
body: <p>I've set a content provider in my application and used LoaderManager to load the data but I am having troubles swapping the cursor to a cursor adapter, i tested if cursor is returning data and it is returning! traced the problem and it seems <code>ad.swapCursor(cursor);</code> is the problem.</p>
  
  <p>What do you think i am doing wrong here? is it could be the content provider?</p>
  
  <pre><code>public class Main extends ListActivity implements LoaderManager.LoaderCallbacks&lt;Cursor&gt; {
  
  public SimpleCursorAdapter ad;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      // TODO Auto-generated method stub
      super.onCreate(savedInstanceState);
      setContentView(R.layout.main);
  
      getLoaderManager().initLoader(0, null, Main.this) != null);
              ad = new SimpleCursorAdapter(this, android.R.id.list, null, null, null, 0); 
  }
  
  public Loader&lt;Cursor&gt; onCreateLoader(int id, Bundle args) {
      // TODO Auto-generated method stub
      Toast.makeText(this, "Started!", Toast.LENGTH_SHORT).show();
      CursorLoader cursorLoader = new CursorLoader(getBaseContext(),
              AviatorContentProvider.LISTS_URI, null, null, null, null);
      if(cursorLoader != null){
          Toast.makeText(this, "This thing is heavy!", Toast.LENGTH_SHORT).show();
      }
  
      return cursorLoader;
  
  }
  
  public void onLoadFinished(Loader&lt;Cursor&gt; cursorLoader, Cursor cursor) {
      // TODO Auto-generated method stub
      ad.swapCursor(cursor);
  
  }
  
  public void onLoaderReset(Loader&lt;Cursor&gt; arg0) {
      // TODO Auto-generated method stub
  
  }}
  </code></pre>
  
  <p>Thanks</p>