Saturday, February 23, 2013

[android-developers] How to check if screen is held touched?

Ok, so I'm having a little problem with OnTouchListener on android 2.3+ devices.
I'm making a game, when you touch your screen, the player jumps, and if you hold your screen touched the player falls slower.
Everything seem good on my android 2.2 device. Because I get MotionEvent.ACTION_MOVE even if my finger isn't moving on the screen, but on android 2.3+ devices I need to move my finger to get ANY event. How can I make that when I hold the screen touched I get onTouch() some kind other method called? Yes I tried, making a isTouched boolean variable, and set it to true when I get MotionEvent.ACTION_DOWN, or ACTION_MOVE and to false when I get ACTION_CANCEL or ACTION_UP. At first, it seemed to have done the trick, but later on, it started bugging again. So is there ANY kind of way to check if screen is touched using Android API? And could someone explain me why this is happening? 

By the way, sorry for reposing, I though I had problem solved but I didn't, and I don't know how to delete my other post, I messed something up there.

--
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments:

Post a Comment