سؤال

I have searched alot of this issue on google but unable to get any help.My question is how to get pixel position of android screen where the user has tapped?

هل كانت مفيدة؟

المحلول

this does the job.

public boolean onTouchEvent(MotionEvent event) {

        float x = event.getX();
        float y = event.getY();

نصائح أخرى

This is probably what you're looking for: onTouchEvent

Are you looking for getRawX and getRawY?

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top