title: Async Task in android not working
body: <p>This is a follow up question from my question <a href="https://stackoverflow.com/questions/8186635/thread-exiting-error-in-android/8186771#8186771">thread exiting error in android</a></p>
  
  <p>I created an async task but the values do not show up in the list view....</p>
  
  <pre><code>public class History extends Activity implements OnItemClickListener
  {
  /** Called when the activity is first created. */
  ListView list;
  
  //LIST OF ARRAY STRINGS WHICH WILL SERVE AS LIST ITEMS
  ArrayList&lt;String&gt; listItems;
  
  //DEFINING STRING ADAPTER WHICH WILL HANDLE DATA OF LISTVIEW
  ArrayAdapter&lt;String&gt; adapter;
  private String resDriver,resPassenger,ID;
  private ProgressDialog dialog;
  ArrayList&lt;HashMap&lt;String, Object&gt;&gt; listInfo = new ArrayList&lt;HashMap&lt;String, Object&gt;&gt;();
  HashMap&lt;String, Object&gt; item;
  JSONObject jDriver;
  //JSONObject jPassenger;
  
  // Make strings for logging
  private final String TAG = this.getClass().getSimpleName();
  private final String RESTORE = ", can restore state";
  private final String state = "Home Screen taking care of all the tabs";
  @Override
  public void onCreate(Bundle savedInstanceState)
  {
      super.onCreate(savedInstanceState);
      Intent loginIntent = getIntent();
      ID = loginIntent.getStringExtra("ID");
      listItems = new ArrayList&lt;String&gt;();
      Log.i(TAG, "Started view active rides");
      setContentView(R.layout.searchresults);
      list = (ListView)findViewById(R.id.ListView01);
      list.setOnItemClickListener(this);
      adapter=new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_1,listItems);
  
      list.setAdapter(adapter);
      getInfo();
  }
  @Override
  public void onItemClick(AdapterView&lt;?&gt; arg0, View v, int position, long arg3)
  {
  // TODO Auto-generated method stub
      Toast.makeText(this, "u clicked " + listItems.get(position) ,Toast.LENGTH_LONG).show();
  }
  
  public void getInfo(){
  
      DownloadInfo task = new DownloadInfo();
      task.execute(new String[] { "http://www.vogella.de" });
  
  }
  
  private class DownloadInfo extends AsyncTask&lt;String, Void , ArrayList&lt;String&gt;&gt;{
  
      @Override
      protected ArrayList&lt;String&gt; doInBackground(String ... strings) {
          ArrayList&lt;String&gt; listItems1;
          jDriver = new JSONObject();
          try {
              jDriver.put("ID", ID);
              jDriver.put("task", "GET DATES");
  
          } catch (JSONException e1) {
              // TODO Auto-generated catch block
              e1.printStackTrace();
          }
          listItems1 = new ArrayList&lt;String&gt;();
          Log.i(TAG,"Sending data for the driver rides");
          resDriver = HTTPPoster.sendJson(jDriver,"URL"); // Any Server URL
  
          JSONObject driver;
          try {
              driver = new JSONObject(resDriver);
              Log.i(TAG,"Recieved Driver details");
              if ( driver.getString("DATABASE ERROR").equals("False")){
                  int length = Integer.parseInt( driver.getString("length"));
                  Log.i(TAG,"length is " + length);
                  for( int i =0 ; i&lt; length ; i++){
                      String info = driver.getString(Integer.toString(i));
                      String[] array = info.split(",");
                      Log.i(TAG,"array is " + Arrays.toString(array));
                      Log.i(TAG,"Date "+ array.length);
                      Log.i(TAG,"DONE WITH THE LOOP");
                      //listInfo.add(item);
                      Log.i(TAG,"Date is"+array[0]);
                      listItems1.add(array[0]);                           
                  }
              }
          } catch (JSONException e) {
          // TODO Auto-generated catch block
              listItems1.add("No driver rides created");
          }
          return listItems1;
      }
  
      @Override
      protected void onPostExecute(ArrayList&lt;String&gt; result) {
  
          listItems = result;
          adapter.notifyDataSetChanged();
      }
  }
  }
  </code></pre>
  
  <p>The problem is that the values in the adapter do not get modified...</p>