title: Load data from multiple loaders/cursors into a listview in android
body: <p>I'am loading data into listview from cursors by initiating multiple loaders. I want my listview to show the data from all cursors but data in listview is changing immediately with a 2 seconds interval and showing data of only last cursor. Please help me. Where iam going wrong? Do I have to merge the cursors? </p>
  
  <p>Inside onCreateView() of my fragment :</p>
  
  <pre><code>  for (int i = 0; i &lt; idsArray.length; i++) {
          Bundle b = new Bundle();
          b.putInt("id", idsArray[i]);
          getLoaderManager().initLoader(idsArray[i], b, this);  //initiating multiple loaders
      }
  
      adapter = new CustomAdapter(getActivity(), R.layout.list_row, null, column_names_array, ui_ids_array, 0);
      listView.setAdapter(adapter);
  </code></pre>
  
  <p>And loader callback methods : </p>
  
  <pre><code>@Override
  public Loader&lt;Cursor&gt; onCreateLoader(int arg0, Bundle b) {
      Builder uriBuilder = MY_PROVIDER_URI.buildUpon();
      uriBuilder.appendPath("categories"); 
      uriBuilder.appendPath(String.valueOf(b.getInt("id")));  
      uriBuilder.appendPath("data");
      return new CursorLoader(getActivity(), uriBuilder.build(), null, null, null, null); 
  }
  
  @Override
  public void onLoadFinished(Loader&lt;Cursor&gt; loader, Cursor data) {
      if(adapter != null &amp;&amp; data != null){ 
          adapter.swapCursor(data); 
          adapter.notifyDataSetChanged(); 
      } 
  }
  
  @Override
  public void onLoaderReset(Loader&lt;Cursor&gt; loader) {
          adapter.swapCursor(null);
  }
  </code></pre>
  
  <p>And here is my adapter class : </p>
  
  <pre><code>public class CustomAdapter extends SimpleCursorAdapter {
  Cursor cursor;
  Context context;
  Activity activity;
  int layout;
  
  public CustomAdapter(Context context, int layout, Cursor c, String[] from, int[] to, int flags ) {
      super(context, layout, c, from, to, flags);
      this.cursor = c;
      this.context = context;
      this.activity = (Activity) context;
      this.layout = layout;
  }
  
  @Override
  public View newView(Context context, Cursor cursor, ViewGroup parent) {
      return LayoutInflater.from(context).inflate(this.layout, parent, false);
  }    
  
  @Override 
  public void bindView(View view, Context context, Cursor cursor) {
      super.bindView(view, context, cursor);
      ViewHolder holder = (ViewHolder) view.getTag();
      if (holder == null) {
          holder = new ViewHolder();
          //finding UI elements in list row here
          view.setTag(holder);
          }  
           //binding data to views of viewholder here
       } 
  
      static class ViewHolder {
      //variables of all my UI elements
       }
    }
  </code></pre>