ListFragment not populated from ContentProvider
I'm trying to implement a very simple list application loading data from an sqllite database. I'm adapting code from varisous tutorials, but I suppose I'm missing something. 

Here's what I have : 

* A list activity that contains a single Fragment 
* A ContentProvider that uses a subclass of SQLiteOpenHelper to manage creation and query in the database
* The single fragment is a subclass of ListFragment which creates a SimpleCursorAdapter : 

    public class ImprovListFragment extends ListFragment implements LoaderCallbacks<Cursor> {
     // private Cursor cursor;
     private SimpleCursorAdapter adapter;
    
     @Override
     public void onActivityCreated(Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);

        // Fields from the database (projection)
        // Must include the _id column for the adapter to work
        String[] from = new String[] { ImprovDbTable.COL_TITLE};
        // Fields on the UI to which we map
        int[] to = new int[] { R.id.improvListItem_title };

        Context context = this.getActivity();
        
        this.getLoaderManager().initLoader(0, null, this);
        adapter = new SimpleCursorAdapter(context, R.layout.improv_list_item, null, from,
                to, 0);
        setListAdapter(adapter);
     }
      // Creates a new loader after the initLoader () call
      @Override
      public Loader<Cursor> onCreateLoader(int id, Bundle args) {
        String[] projection = { ImprovDbTable.COL_ID, ImprovDbTable.COL_TITLE};
        CursorLoader cursorLoader = new CursorLoader(this.getActivity(),
                ImprovContentProvider.CONTENT_URI, projection, null, null, null);
        return cursorLoader;
      }

     @Override
     public void onLoadFinished(Loader<Cursor> loader, Cursor data) {
        adapter.swapCursor(data);
     }

     @Override
     public void onLoaderReset(Loader<Cursor> loader) {
        // data is not available anymore, delete reference
        adapter.swapCursor(null);
     }
    }
ListFragment not populated from ContentProvider
===

I'm trying to implement a very simple list application loading data from an sqllite database. I'm adapting code from varisous tutorials, but I suppose I'm missing something. 

Here's what I have : 

* A list activity that contains a single Fragment 
* A ContentProvider that uses a subclass of SQLiteOpenHelper to manage creation and query in the database
* The single fragment is a subclass of ListFragment which creates a SimpleCursorAdapter : 

    public class ImprovListFragment extends ListFragment implements LoaderCallbacks<Cursor> {
     // private Cursor cursor;
     private SimpleCursorAdapter adapter;
    
     @Override
     public void onActivityCreated(Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);

        // Fields from the database (projection)
        // Must include the _id column for the adapter to work
        String[] from = new String[] { ImprovDbTable.COL_TITLE};
        // Fields on the UI to which we map
        int[] to = new int[] { R.id.improvListItem_title };

        Context context = this.getActivity();
        
        this.getLoaderManager().initLoader(0, null, this);
        adapter = new SimpleCursorAdapter(context, R.layout.improv_list_item, null, from,
                to, 0);
        setListAdapter(adapter);
     }
      // Creates a new loader after the initLoader () call
      @Override
      public Loader<Cursor> onCreateLoader(int id, Bundle args) {
        String[] projection = { ImprovDbTable.COL_ID, ImprovDbTable.COL_TITLE};
        CursorLoader cursorLoader = new CursorLoader(this.getActivity(),
                ImprovContentProvider.CONTENT_URI, projection, null, null, null);
        return cursorLoader;
      }

     @Override
     public void onLoadFinished(Loader<Cursor> loader, Cursor data) {
        adapter.swapCursor(data);
     }

     @Override
     public void onLoaderReset(Loader<Cursor> loader) {
        // data is not available anymore, delete reference
        adapter.swapCursor(null);
     }
    }