Issue
I am writing an Activity
that implements View.OnTouchListener
. I noticed that if I press my finger to the screen, change the screen orientation (which triggers Activity
destruction and recreation) while keeping my finger down, and then lift my finger, the OnTouchListener.onTouch
doesn't get called. It seems like it should, since lifting my finger is a MotionEvent.ACTION_UP
. Am I misunderstanding the library/using it wrong, or is this a bug in the framework?
Solution
Before the rotation starts, your onTouch
listener should receive a MotionEvent.ACTION_CANCEL
completing the event stream. You don't receive an additional MotionEvent.ACTION_UP
because no new event stream has been started.
Answered By - Abhay Buch
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.