title: Android: OnItemClickListener returns the value of the last item
body: <p>the code bellow was working so fine with me but now i don't know what's wrong with it!! whenever i click to an item it put the value of the last item to the intent! any idea?</p>
  
  <pre><code> protected void onPostExecute(List&lt;HashMap&lt;String, String&gt;&gt; result) {
          customList=new ArrayList&lt;&gt;();
          for (int i = 0; i &lt; result.size(); i++) {
              HashMap&lt;String, String&gt; appointement = result.get(i);
              String fromT = appointement.get("fromT");
              String toT = appointement.get("toT");
              String date = appointement.get("date");
              //int doctorid=Integer.parseInt(id.replaceAll("[\\D]",""));
              addAvailableAppoint(fromT, toT, date);
          }
          updateListView();
      }
  }
  
  private void addAvailableAppoint(final String fromT, final String toT, final String date) {
      customList.add(new AvailabilityList(fromT));
      lv.setOnItemClickListener(new AdapterView.OnItemClickListener() {
          @Override
          public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {
              Log.i("items", "fromt " + fromT + "tot: " + toT);
              Intent intent = new Intent(MakeAppointementActivity.this, AppointementActivity.class);
              intent.putExtra("Doctor's name", DoctorName);
              intent.putExtra("Doctor's infos", DoctorInfos);
              intent.putExtra("fromT", fromT);
              intent.putExtra("toT", toT);
              intent.putExtra("date", date);
              startActivity(intent);
          }
      });
  
  }
  
  // split new function for update listview
  private void updateListView(){
      ArrayAdapter adapter=new DoctorAvailabilityAdapter(MakeAppointementActivity.this,R.layout.list_items,customList);
      adapter.notifyDataSetChanged();
      lv.setAdapter(adapter);
  </code></pre>