title: Cursor-driven content in ViewPager
body: <p>I'd like to use a ViewPager to show several items per page from a single Cursor (originally from a ContentProvider). The layout will be shown as a grid and will include images and text for each item. There will be frequent additions and deletions from the list which need to be reflected in the UI without having to rebuild the data structures (which may preclude some options below).</p>
  
  <p>Current process:</p>
  
  <ol>
  <li>Instantiate cursor in main activity.</li>
  <li>Create my own Cursor Adapter class extended from PagerAdapter which takes in the cursor. The cursor is used to determine the number of pages the ViewPager will have through getCount() (and then adjusted according to how many items will be shown per page).</li>
  <li>In the Cursor Adapter getItem method, it creates the fragment which will eventually contain a subset of the list.</li>
  </ol>
  
  <p>At this stage, I'm not sure which is the best method to take. Do I:</p>
  
  <p>A. Pass the Cursor and an index to the Fragment to display the next page of results (e.g. having a setCursorIndex( Cursor, int ) method. <em>(Does sharing Cursors across Fragments cause issues even if it's in the same Activity?)</em></p>
  
  <p>B. Pass in a list of ContentUris strings which would obtain the results. <em>(Would this prevent updates to the list without having to rebuild?)</em></p>
  
  <p>C. Build an arguments bundle containing the items (a list containing byte arrays for images, and text). <em>(This seems inefficient due to the use of images.)</em></p>
  
  <p>D. Re-create a new Cursor in each Fragment having received a starting index from the adapter. (Inefficient?)</p>
  
  <p>Many thanks for your help.</p>