How does an android application associate and input event with a view specifically speaking which class and which method?
How does an android application associate and input event with a view specifically speaking
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
When the screen is touched, a MotionEvent is dispatched to the top most View (the content view of the Activity). The content view then does some calculations on area and determines if it has children that are able to receive the MotionEvent and passes the MotionEvent to the View that the MotionEvent falls into via a
onTouchEvent(MotionEvent). This is repeated down the View heirarchy until a view return true or the MotionEvent comes back to the top level View at which point it decides to either handle or discard it.Refer to :
View#onTouchEvent(MotionEvent)
ViewGroup#onInterceptTouchEvent(MotionEvent)