title: Show Progress Indicator before fill listview using CursorLoader
body: <p>What better way to show a progress indicator while my listview is not filled with data of database?</p>
  
  <p>I found some examples of how to do this, using assynctask, but in my case, I am using <code>Loader</code> /<code>CursorLoader</code>.</p>
  
  <pre><code>public class TestActivity extends SherlockFragmentActivity implements
      LoaderCallbacks&lt;Cursor&gt; {
  
  SimpleCursorAdapter mAdapter;
  ListView mListView;
  
  private static final String[] UI_BINDING_FROM = new String[] {
          TestDBAdapter.KEY_NAME, TestDBAdapter.KEY_ICON };
  
  private static final int[] UI_BINDING_TO = new int[] { R.id.text, R.id.icon };
  
  @Override
  public void onCreate(Bundle savedInstanceState) {
  
      super.onCreate(savedInstanceState);
  
      setContentView(R.layout.activity_Test);
  
      mListView = (ListView) findViewById(R.id.listview);
  
      mAdapter = new TestAdapter(getApplicationContext(),
              R.layout.list_item_Test, null, UI_BINDING_FROM,
              UI_BINDING_TO, 0);
  
      mListView.setAdapter(mAdapter);
  
      getSupportLoaderManager().initLoader(0, null, this);
  
  }
  
  @Override
  public Loader&lt;Cursor&gt; onCreateLoader(int id, Bundle args) {
  
  
      Uri uri = ContentProviderTest.CONTENT_URI;
  
      CursorLoader cursorLoader = new CursorLoader(
              this, 
              uri,
              null,
              null,
              null,
              null);
  
      return cursorLoader;
  
  }
  
  @Override
  public void onLoadFinished(Loader&lt;Cursor&gt; loader, Cursor data) {
      mAdapter.swapCursor(data);
  }
  
  @Override
  public void onLoaderReset(Loader&lt;Cursor&gt; loader) {
      mAdapter.swapCursor(null);
  }
  }
  </code></pre>
  
  <p>A possible solution, would be to create a new class extending <code>ListFragment</code> and use the <code>setListShown()</code> method , but I do not know if it is the best way to solve this issue.</p>
  
  <p>Thanks</p>