title: Setonitemclicklistener not working in run()
body: <p>In the following code the setonitemclicklistener of listView not working. I don't know what is missing.</p>
  
  <pre><code>public class OffersActivity extends ListActivity {
  private ProgressDialog pDialog;
  JSONParser jsonParser = new JSONParser();
  ArrayList&lt;HashMap&lt;String, String&gt;&gt; offersList;
  OfferAdapter offerAdapter;  
  JSONArray offers = null;
  private static final String OFFER_URL = "My URL of PHP file";
  
   static final String OFFER_ID = "offer_id";
   static final String OFFER_CONTENT = "offer_content";
   static final String OFFER_PHOTO = "offer_photo";
   static final String OFFER_PHOTO_THUMB = "offer_photo_thumb";
   static final String OFFER_INTERNAL_PHOTO = "offer_internal_photo";
   static final String OFFER_INTERNAL_PHOTO_THUMB = "offer_internal_photo_thumb";
   static final String OFFER_CREATED_DATE = "offer_created_date";
   static final String OFFER_ORD = "offer_ord";
   static final String OFFER_STATE = "offer_state";
   static final String OFFER_LAST_UPDATE = "offer_last-update";
   static final String OFFER_TITLE = "offer_title";
   static final String OFFER_OLD_PRICE = "offer_old_price";
   static final String OFFER_CURRENT_PRICE = "offer_current_price";
   static final String OFFER_OCAZION = "offer_ocazion";
  
  
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.offers_list);
      offersList = new ArrayList&lt;HashMap&lt;String, String&gt;&gt;();
       new LoadOffer().execute();
  }
  class LoadOffer extends AsyncTask&lt;String, String, String&gt; {
  
      @Override
      protected void onPreExecute() {
          super.onPreExecute();
          pDialog = new ProgressDialog(OffersActivity.this);
          pDialog.setMessage(getResources().getString(R.string.loadOffers));
          pDialog.setIndeterminate(false);
          pDialog.setCancelable(false);
          pDialog.show();
      }
  
      protected String doInBackground(String... args) {
          List&lt;NameValuePair&gt; params = new ArrayList&lt;NameValuePair&gt;();
          JSONArray jsonArray = jsonParser.makeHttpRequest(OFFER_URL, "GET",params);
          JSONObject jsonObject = null;
          Log.d("Offer JSON: ", jsonArray.toString());
  
          try {
              for (int i = 0; i &lt; jsonArray.length(); i++) {
                  jsonObject = jsonArray.getJSONObject(i);
  
                  String offer_id = jsonObject.getString(OFFER_ID);
                  String offer_content = jsonObject.getString(OFFER_CONTENT);
                  String offer_photo = jsonObject.getString(OFFER_PHOTO);
                  String offer_photo_thumb = jsonObject.getString(OFFER_PHOTO_THUMB);
                  String offer_internal_photo = jsonObject.getString(OFFER_INTERNAL_PHOTO);
                  String offer_internal_photo_thumb = jsonObject.getString(OFFER_INTERNAL_PHOTO_THUMB);
                  String offer_created_date = jsonObject.getString(OFFER_CREATED_DATE);
                  String offer_ord = jsonObject.getString(OFFER_ORD);
                  String offer_state = jsonObject.getString(OFFER_STATE);
                  String offer_last_update = jsonObject.getString(OFFER_LAST_UPDATE);
                  String offer_title = jsonObject.getString(OFFER_TITLE);
                  String offer_old_price = jsonObject.getString(OFFER_OLD_PRICE);
                  String offer_current_price = jsonObject.getString(OFFER_CURRENT_PRICE);
                  String offer_ocazion = jsonObject.getString(OFFER_OCAZION);
  
                  HashMap&lt;String, String&gt; map = new HashMap&lt;String, String&gt;();
  
                  map.put(OFFER_ID, offer_id);
                  map.put(OFFER_CONTENT, offer_content);
                  map.put(OFFER_PHOTO, offer_photo);
                  map.put(OFFER_PHOTO_THUMB, offer_photo_thumb);
                  map.put(OFFER_INTERNAL_PHOTO, offer_internal_photo);
                  map.put(OFFER_INTERNAL_PHOTO_THUMB, offer_internal_photo_thumb);
                  map.put(OFFER_CREATED_DATE, offer_created_date);
                  map.put(OFFER_ORD, offer_ord);
                  map.put(OFFER_STATE, offer_state);
                  map.put(OFFER_LAST_UPDATE, offer_last_update);
                  map.put(OFFER_TITLE, offer_title);
                  map.put(OFFER_OLD_PRICE, offer_old_price);
                  map.put(OFFER_CURRENT_PRICE, offer_current_price);
                  map.put(OFFER_OCAZION, offer_ocazion);
  
                  offersList.add(map);
              }
  
          } catch (JSONException e) {
              e.printStackTrace();
          }
  
          return null;
      }
  
      protected void onPostExecute(String file_url) {
          pDialog.dismiss();
          runOnUiThread(new Runnable() {
              public void run() {
  
                  offerAdapter = new OfferAdapter(OffersActivity.this, offersList);
                  setListAdapter(offerAdapter);
  
                  getListView().setOnItemClickListener(new OnItemClickListener() {
  
                      @Override
                      public void onItemClick(AdapterView&lt;?&gt; arg0, View arg1, int arg2,
                              long arg3) {
                              // not work..
                          Toast.makeText(OffersActivity.this, "Hello", Toast.LENGTH_SHORT).show();
                          // not work too..
                          System.out.println("Hello");
                      }
  
                  });
  
              }
          });
  
      }
  
  }
  
  }
  </code></pre>