Answer the question
In order to leave comments, you need to log in
Android. Too often come onTouchEvent
Wrote a small toy. And everything would be fine, but when you click on the screen, it starts to slow down.
I just can't deal with this mess.
Neither falling asleep in the handler, nor a forced exit, if enough time has not passed, which are advised on bourgeois forums, does not help.
Here is the toy itself in which you can observe the effect in all its glory:
market.android.com/details?id=y.games.op_volcano
Answer the question
In order to leave comments, you need to log in
I remember when I was playing around with development for Android, transferring the click processing to the show method helped from this.
Those. in the click handler, the flag was simply put there was a click / there was no + coordinates.
And in the display method, I already analyzed what, where and how it was clicked.
OnTouchEvent comes on any screen touch event. That is, if you intercept the touch event, but do not select its specific type, touch down, touch move and touch up are processed. Moreover, touch move comes over 9000 times while you press your finger to the screen and move it.
Or am I not talking about that? In general, in such cases it would be good to attach the code, otherwise nothing is clear.
At one time (these were G1 times) I was helped by Thread.sleep (50) inside onTouchEvent.
Not that it would help much, let's say the drop in FPS when you touch the screen with your finger has decreased by half.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question