Reputation: 7442
Hi I want to get x and y position of screen where the user has touched. How can I do that?
Upvotes: 1
Views: 3664
Reputation: 1876
It depends a little on the way you're doing your view. Usually you attach an event listener to your view in your onCreate() method. More here
If you have a custom view then you might use a handler instead, which means you override the onTouch() method in your view.
Either way you'll get an event object which has the x and y values.
Upvotes: 3