title: AsyncTask not loading data properly.
body: <pre><code>public class HomeActivity extends Activity{
  
  
  //   public ArrayList&lt;User&gt; users1 = new ArrayList&lt;User&gt;();
      @Override
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
  
        // ListView lv = (ListView) findViewById(R.id.user_crumbs_list);
  
      final ArrayList&lt;User&gt; users1 = new ArrayList&lt;User&gt;();  
      User user = null;
         class AsyncLoader extends AsyncTask&lt;User,Void, ArrayList&lt;User&gt;&gt; {
             ProgressDialog dialog;
  
          @Override
  
          protected void onPreExecute(){
  
                 dialog = new ProgressDialog(HomeActivity.this); // App - your main activity class
                 dialog.setMessage("Please, wait...");
                 dialog.show();
          }
  
          @Override
          protected ArrayList&lt;User&gt; doInBackground(User... users) {
              String response = "";
  
              for (User user:users)
  
                  try {
  
                    try {
                          user = new User("4eeb34c6d80e8f1214000000");
                          user.getFollowingCrumbsUpList();
                      } catch (IOException e) {
                          // TODO Auto-generated catch block
                          e.printStackTrace();
                      } catch (JSONException e) {
                          // TODO Auto-generated catch block
                          e.printStackTrace();
                      }
  
  
  
  
  
                      for(User u : user.following){
                          users1.add(u);
                      }
  
  
  
                  } catch (Exception e) {
                      e.printStackTrace();
                  }
  
          return users1;
          }
  
          protected void onPostExecute(String result) {
              dialog.dismiss();
              return;
  
          }
  
  
          }
  
  
  
  
  
  
          AsyncLoader task = new AsyncLoader();
          task.execute(user);
  
  
  
          setContentView(R.layout.user_main_tab_home);
          final UserFollowingListAdapter csl = new          UserFollowingListAdapter(this,R.layout.user_list_item,users1,this);
          ListView lv = (ListView) findViewById(R.id.user_list);          
  
  
  
  
  
  
  
  
  
         public void showError(){
          new AlertDialog.Builder(this)
          .setTitle(" Oops , Server down :( ")
          .setPositiveButton("Ok", new DialogInterface.OnClickListener() {
  
              @Override
              public void onClick(DialogInterface arg0, int arg1) {
                  // TODO Auto-generated method stub
  
              }
              //
          }).setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
              public void onClick(DialogInterface dialog, int whichButton) {
                  // Do nothing.
              }
          }).show();
  
        }
  }
  </code></pre>
  
  <p>This is going on an infinite loop where the data doesn't load at all and the dialog goes on an infinite loop till I click on it. My goal is to load some initial amount of data and then fetch data as per the user scroll. As of now, I'm not even able to display the data.</p>
  
  <p>After debugging I found out that user1 variable has no values stored in it, which I'm not able to find out why, even though the iteration is taking place. </p>
  
  <p>Any clues as to where I am going wrong?</p>