@Override
 public void onResume() {
   super.onResume();
   if (adapter.getCount() == 0 && !loader.isNothingToLoad()) {
     loader.load();
   }
 }
  @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);
    }
  }