Call setOnTouchListener on the ImageView. The OnTouchListener instance you pass in as the argument will have the onTouch method called on it with a MotionEvent instance with coordinates. You can also override the onTouchEvent method in your Activity subclass to get called for any touch events not handled by views.
On Sep 26, 9:42 pm, bbbbb <adlak...@gmail.com> wrote: > Hi, I'm trying to get coordinates of the mouse, but there seems to be > no easy ways. > Can't make the MotionEvent object because the constructor is private. > Can anyone please tell me how to get the coordinates of the touch/ > pointer/mouse? > Thanks > PS: I only want the touch coordinates of ImageView, but wouldn't mind > the touch coordinates anywhere on the screen. thanks. -- 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