SHARE
TWEET

Untitled

a guest Jun 18th, 2019 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. private void onResponse(String response) {
  2.  
  3.  
  4.    NewEnquiryPagination newEnquiries = new Gson().fromJson(response, new TypeToken<NewEnquiryPagination>() {
  5.     }.getType());
  6.  
  7.     Log.i("@sandy,", "newEnquiriesFirstPage: " + newEnquiries);
  8.  
  9.     if (listOfEnquiries !=null) {
  10.  
  11.         adapter.addAll(newEnquiries.getContent());
  12.  
  13.         if (currentPage <= TOTAL_PAGES) adapter.addLoadingFooter();
  14.         else isLastPage = true;
  15.     }
  16. }
  17.  
  18.  
  19.  
  20. private void onResponseNextPage(String response) {
  21.  
  22.     adapter.removeLoadingFooter();
  23.     isLoading = false;
  24.     NewEnquiryPagination newEnquiries = new Gson().fromJson(response, new TypeToken<NewEnquiryPagination>() {
  25.     }.getType());
  26.     if (listOfEnquiries != null ) {
  27.  
  28.         adapter.addAll(newEnquiries.getContent());
  29.  
  30.         if (currentPage != TOTAL_PAGES) adapter.addLoadingFooter();
  31.         else isLastPage = true;
  32.     }
  33. }
  34.      
  35. if (newEnquiries.getContent() != null && newEnquiries.getContent().size() > 0) {
  36.         Log.i("@sss","OnRes");
  37.         adapter.addAll(newEnquiries.getContent());
  38.         if (currentPage <= TOTAL_PAGES) adapter.addLoadingFooter();
  39.         else isLastPage = true;
  40.     } else {
  41.       //Your else condition
  42.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top