That gives you the x and y coordinates when there's a touch event, not an
onClick, onLongClick or onContextMenuSomething.

On Sun, Feb 22, 2009 at 2:55 PM, Lewis <[email protected]>wrote:

>
> This is how i found x and y coords of a click:
>
> create an ontouchlistener, override 'onTouch' and use getRawX() to get
> an x coord.
>
>
>  final OnTouchListener myListener = new OnTouchListener()
>        {
>
> public boolean onTouch(View v, MotionEvent event)
> {
>
>
> if (event.getAction() == MotionEvent.ACTION_DOWN)
>                   {
>                    xInit = event.getRawX();
>                    yInit= event.getRawY();
>                  }
>            }
> return false;
> }
>
>
>
>  Hope this helps
>
> Lewis
>
>
> On Feb 22, 12:15 pm, J. Pablo Fernández <[email protected]> wrote:
> > It seems it's also not possible to know where exactly was the long
> clicked
> > performed in a view to trigger a context menu. :S
> >
> > On Sat, Feb 21, 2009 at 3:41 PM, J. Pablo Fernández <[email protected]
> >wrote:
> >
> > > Hello,
> >
> > > When you receive clicks and long clicks, how do you get the x and y
> > > coordinates that were clicked?
> >
> > > Thanks.
> > > --
> > > J. Pablo Fernández <[email protected]> (http://pupeno.com)
> >
> > --
> > J. Pablo Fernández <[email protected]> (http://pupeno.com)
> >
>


-- 
J. Pablo Fernández <[email protected]> (http://pupeno.com)

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

Reply via email to