Hi,
  How could I generate multitouch event in android?
Actually, I have already some ideas for it, but it doesn't work.
Here is my code. Thanks a lot.

========================================code============================================================================
                float   x = 240; 
                float   y = 300;
                float   x1= 320;
                float   y1= 450;
               Instrumentation inst=new Instrumentation();

               PointerCoords[] coords = new PointerCoords[2];
               int[] pointerIds = new int[2];
               pointerIds[0] = 0;
               pointerIds[1] = 1;  
               coords[0] = new PointerCoords();
               coords[1] = new PointerCoords();
               coords[0].x = 400; 
               coords[0].y = 200;
               coords[1].x = 400; 
               coords[1].y = 500;
          
               MotionEvent me = 
 
MotionEvent.obtain(SystemClock.uptimeMillis(),eventTime,MotionEvent.ACTION_DOWN,2,pointerIds,coords,0,1,1,0,0,0,0);
               inst.sendPointerSync(me);

               eventTime+=400;
               coords[0].y -= 100;
               coords[1].y += 100;   
               me = 
MotionEvent.obtain(SystemClock.uptimeMillis(),eventTime,MotionEvent.ACTION_MOVE,2,pointerIds,coords,0,1,1,0,0,0,0);

               eventTime+=400;
               coords[0].y -= 100;
               coords[1].y += 100;   
               me = 
MotionEvent.obtain(SystemClock.uptimeMillis(),eventTime,MotionEvent.ACTION_UP,2,pointerIds,coords,0,1,1,0,0,0,0);
======================================================================================================================================

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to