예제 #1
0
 @Override
 public void onResume() {
   super.onResume();
   if (adapter.getCount() == 0 && !loader.isNothingToLoad()) {
     loader.load();
   }
 }
예제 #2
0
  @Override
  protected void initialize(Activity activity) {
    if (adapter == null) {
      adapter = new FriendsAdapter();
      builder = new UrlBuilder().s("users").s("recommendations");
      loader = new GradualLoader(activity);
      loader.setUrlBuilder(builder);
      loader.setOnLoadCompleteListener(
          new OnLoadCompleteListener() {

            @Override
            public void onComplete(JSONArray response) {
              adapter.addAll(response);
              setAdapter(adapter);
            }
          });
    } else {
      setAdapter(adapter);
    }
  }