DataListener

public interface DataListener

Implementation of this class will be notified each time there is a change in the SqlPaginator.

Methods

dataUpdate

void dataUpdate(List<Map> records)

Use this method to update whichever data structure you using to hold the data.

This is invoked when new data is received. it asynchronously on the doBackground method of an AsyncTask.

Please note this method is never run on the main UI thread.

Parameters:
  • records – list of data for the current page.

onFirstPageDataLoaded

void onFirstPageDataLoaded(boolean hasMorePages)

Triggered when data for the first page has been loaded and is ready for use.

The data can be accessed on DataListener.dataUpdate(List) method.

Parameters:
  • hasMorePages – true if there are more pages to load.

onLastPageDataLoaded

void onLastPageDataLoaded()

Triggered when data for the last page has been loaded and is ready for use.

The data can be accessed on DataListener.dataUpdate(List) method.

onNextPageDataLoaded

void onNextPageDataLoaded()

Invoked when a new list of records has been added to the current records. this is called after fetchNextPageData();

This method should be run on the main ui thread. on AsyncTask this should be invoked on onPostExecute()

preDataLoad

void preDataLoad(boolean hasMorePages)

Invoked before the next page is loaded.

Parameters:
  • hasMorePages – true if there are more pages to load.