Select Multiple Views while dragging finger in android
<p>I have created multiple views dynamically , in my case <code>textViews</code>. i have given them ids. what iwant is to select all the <code>textViews</code> ids over which i <code>slide my finger</code>. E.g if there are textviews saying A And B and when i slide finger from A to b i should get ids save in my array. Currently I am learning touch. I don't know how to implement it.</p>

<p>Best Regards</p>

<pre><code>  OnTouchListener MyOnTouchListener = new OnTouchListener(){ 
          public boolean onTouch(View v, MotionEvent event) 
          {
              Drawable d = getResources().getDrawable(R.drawable.small_corners);
              switch(event.getAction() &amp; MotionEvent.ACTION_MASK){
                    case MotionEvent.ACTION_DOWN:
                           vibe.vibrate(20);


                               id.add(v.getId());   
                               TextView vv = (TextView) v;
                               val.add(vv.getText().toString()); 
                               vv.setBackgroundDrawable(d);
                               String str = "";



            //A pressed gesture has started, the motion contains the initial starting location.
            return false;
           case MotionEvent.ACTION_POINTER_DOWN:
            //A non-primary pointer has gone down.
            break;
           case MotionEvent.ACTION_MOVE:
            //A change has happened during a press gesture (between ACTION_DOWN and ACTION_UP).
               int check = 0;
               for (int i = 0; i &lt; id.size(); i ++)
               {
                   if (id.get(i) == v.getId())
                       check = 1;
               }
               if (check != 1)
               {
                   id.add(v.getId());
                   vv = (TextView) v;
                   val.add(vv.getText().toString()); 
                   vv.setBackgroundDrawable(d);
               }
            return false;
           case MotionEvent.ACTION_MASK:
                //A change has happened during a press gesture (between ACTION_DOWN and ACTION_UP).

                break;
           case MotionEvent.ACTION_OUTSIDE:
                //A change has happened during a press gesture (between ACTION_DOWN and ACTION_UP).

                break;


           case MotionEvent.ACTION_UP:
            //A pressed gesture has finished.

              break;

           case MotionEvent.ACTION_POINTER_UP:
            //A non-primary pointer has gone up.

            break;
           }

           return false;
          }
         };
</code></pre>
