title: Android findViewById() with onFling in ListView problem
body: <p>I have a class that extend ListActivity.
  This class show a AbsListView filled with bus IDs and a bus Names on each row...
  I try to handle the bus Name of a row when I make a swipe gesture on...('onFling') but when I do that, the gesture is handled correctly but I can just get the Views (with findViewByID()) of the first row ....I need to get the  Views of the Flinged row!</p>
  
  <p>Thank you!</p>
  
  <p>This is my code...:</p>
  
  <pre><code>public class dayBusList extends ListActivity{
  
       AbsListView lv;
   AABDatabaseManager db;
  
       GestureDetector mGestureDetector = null;
   View.OnTouchListener mGestureListener = null;
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
  
  
          db = new AABDatabaseManager(dayBusList.this);
          setListAdapter(new SpeechListAdapter(this));
  
  
  
          lv = getListView();
          lv.setTextFilterEnabled(true);
          lv.setBackgroundColor(0xffffffff);
          lv.setFastScrollEnabled(true);
          lv.setSoundEffectsEnabled(true);
  
          //Gesture detector for swipe...
  
           mGestureDetector = new GestureDetector(new MyGestureDetector());
  
               mGestureListener = new View.OnTouchListener() {
                  public boolean onTouch(View v, MotionEvent aEvent) {
  
                      if (mGestureDetector.onTouchEvent(aEvent))
                          return true;
                      else
                          return false;
                      }
                  };
         lv.setOnTouchListener(mGestureListener);
  </code></pre>
  
  <p>.......>THE ADAPTER FOR THE LIST VIEW</p>
  
  <pre><code>private class SpeechListAdapter extends BaseAdapter {
  
           private Context mContext;
           private String[] busIDS = db.getDayBusIds();
           private String[] busNAMES = db.getDayBusNames();
  
              public SpeechListAdapter(Context context) {
  
                  mContext = context;
              }
  
              public int getCount() {
                  return busNAMES.length;
              }
  
              public Object getItem(int position) {
                  return position;
              }
  
              public long getItemId(int position) {
                  return position;
              }
  
              public View getView(int position, View convertView, ViewGroup parent) {
                  SpeechView sv;
  
                  if (convertView == null) {
                      sv = new SpeechView(mContext, busIDS[position],
                              busNAMES[position]);
                  } else {
                      sv = (SpeechView) convertView;
                      sv.setTitle(busIDS[position]);
                      sv.setDialogue(busNAMES[position]);
                  }
                  return sv;
              }
  
           }
  
          private class SpeechView extends LinearLayout {
  
              private TextView busID;
              private TextView busNAME;
  
              public SpeechView(Context context, String title, String words) {
                  super(context);
  
                  this.setOrientation(HORIZONTAL);
  
                  ImageView busIcon = new ImageView(context);
                  busIcon.setImageResource(R.drawable.stm);
                  busIcon.setPadding(2, 20, 5, 20);
                  addView(busIcon,new LinearLayout.LayoutParams(
                          LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
  
                  busID = new TextView(context);
                  busID.setId(1);
                  busID.setTextSize(30);
                  busID.setTextColor(Color.BLUE);
                  busID.setPadding(5, 15, 5, 20);
                  //busID.setPadding(0, 0,10, 0);
                  busID.setText(title);
                  addView(busID, new LinearLayout.LayoutParams(
                          LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
  
                  busNAME = new TextView(context);
                  busNAME.setId(2);
                  busNAME.setGravity(Gravity.TOP);
                  busNAME.setTextSize(15);
                  busNAME.setPadding(0, 0, 0, 0);
                  busNAME.setText(words);
                  busNAME.setTextColor(Color.GREEN);
                  busNAME.setWidth(160);
                  addView(busNAME, new LinearLayout.LayoutParams(
                          LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
               }
  
              public void setTitle(String id) {
                  busID.setText(id);
              }
  
              public void setDialogue(String name) {
                  busNAME.setText(name);
              }
          }
  </code></pre>
  
  <p>.......>THE class for the gesture detection</p>
  
  <pre><code>class MyGestureDetector extends SimpleOnGestureListener {
      private static final int SWIPE_MIN_DISTANCE = 200;
      private static final int SWIPE_MAX_OFF_PATH = 100;
      private static final int SWIPE_THRESHOLD_VELOCITY = 100;
  
      @Override
              public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
                  float dX = e2.getX()-e1.getX();
                  float dY = e1.getY()-e2.getY();
                  if (Math.abs(dY)&lt;SWIPE_MAX_OFF_PATH &amp;&amp;
                      Math.abs(velocityX)&gt;=SWIPE_THRESHOLD_VELOCITY &amp;&amp;
                      Math.abs(dX)&gt;=SWIPE_MIN_DISTANCE ) {
                      if (dX&gt;0) {
                          Toast.makeText(getApplicationContext(), ((TextView) findViewById(1)).getText()+"Right Swipe", Toast.LENGTH_SHORT).show();
                      } else {
                          Toast.makeText(getApplicationContext(), ((TextView) findViewById(1)).getText()+"Left Swipe", Toast.LENGTH_SHORT).show();
                      }
                      return true;
                  } 
                  return false;
              }
  
          }
  </code></pre>