0

So I've got a GDK activity which loads a CardScrollView, it's working fine. However this list can be very long so I'm paginating in the JSON, so only the first 20 or so items are returned. What I'm trying to do is so when the user gets to the end of the list, they "overpull" and see more items show up. Loading the initial list works fine:

mAdapter = new CardCursorScrollAdapter();
mCardScrollView = (CardScrollView)rootLayout.findViewById(R.id.card_scroll_view);
mCardScrollView.setAdapter(mAdapter);
LoaderManager loaderManager = getLoaderManager();
loaderManager.initLoader(LOADER_ID, null, mCallbacks);

However I haven't been able to solve two problems: first, how to detect the over-pull, and second, how to update the CardScrollView with my additional data.

johnarleyburns
  • 1,532
  • 12
  • 13

1 Answers1

0

You can add a Card at the end of your dataset with a loading Text. When you reach this card (you can detect it with the OnItemSelectedListener) call the loader to load the next page. When the loading is finished, call the notifyDataSetChanged of your adapter to refresh the scrollview.

hope this will help.

Jean Vacca
  • 46
  • 2