Advertisement
Semior001

ClassCastException

Sep 11th, 2016
357
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.48 KB | None | 0 0
  1. Backendless.Data.of(News.class).find(new AsyncCallback<BackendlessCollection<News>>() {
  2.     @Override
  3.     public void handleResponse(BackendlessCollection<News> news) {
  4.         final Iterator<News> newsIterator = news.getCurrentPage().iterator();
  5.         // number of checked tweets
  6.         checkedNewsCount = new AtomicInteger(0);
  7.  
  8. //                for(News currentNews : news){
  9. //                    System.out.println("--------");
  10. //                    System.out.println("Body: " + currentNews.getBody());
  11. //                    System.out.println("Author: " + currentNews.getAuthorName());
  12. //                    System.out.println("--------");
  13. //                }
  14.  
  15.         while (newsIterator.hasNext()) {
  16.             News currentNews = newsIterator.next();
  17.             System.out.println("--------");
  18.             System.out.println("Body: " + currentNews.getBody());
  19.             System.out.println("Author: " + currentNews.getAuthorName());
  20.             System.out.println("--------");
  21.         }
  22.         NewsAdapter adapter = newsAdapterRef!=null? newsAdapterRef.get(): null;
  23.         if (adapter != null) adapter.setData(newsList);
  24.         ViewFlipper flipper = flipperRef != null? flipperRef.get(): null;
  25.         if (flipper!= null && flipper.getDisplayedChild() != 0) flipper.showNext();
  26.     }
  27.  
  28.     @Override
  29.     public void handleFault(BackendlessFault backendlessFault) {
  30.         System.out.println("Server reported an error - " + backendlessFault.getMessage());
  31.     }
  32. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement