Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private static void basicPagingAsync() throws InterruptedException
- {
- long startTime = System.currentTimeMillis();
- final AsyncCallback<BackendlessCollection<Restaurant>> callback=new AsyncCallback<BackendlessCollection<Restaurant>>()
- {
- private boolean firstResponse=true;
- public void handleResponse( BackendlessCollection<Restaurant> restaurants )
- {
- if( firstResponse )
- {
- System.out.println( "Total restaurants - " + restaurants.getTotalObjects() );
- firstResponse=false;
- }
- int size = restaurants.getCurrentPage().size();
- System.out.println( "Loaded " + size + " restaurants in the current page" );
- if( size > 0 )
- restaurants.nextPage( this );
- }
- @Override
- public void handleFault( BackendlessFault backendlessFault )
- {
- }
- };
- Backendless.Data.of( Restaurant.class ).find( callback );
- System.out.println( "Total time (ms) - " + (System.currentTimeMillis() - startTime ));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement