I have an application that is used outdoors, under any conditions. They are located on B & N Nook root tablets running Android 2.1. They have optical touch detection, not pressure, so a large drop of rain on the screen can "turn off" the device because it is detected as a press, and then all other presses are not detected.
Part one: in the activity I use, I manually detect long (10 seconds) on-screen presses that are consistent with the droplet that starts blocking pressing. I am using dispatchTouchEvent () for this and this is normal.
Part two. So, I am discovering a new activity and actually drawing rain and telling the user to "erase this drop of rain." The new activity opens perfectly, and I can successfully draw circles anywhere.
The problem is that the new activity does not receive any sensory events for this very first press ... a long press that has not stopped yet. Not getting the "new" ACTION_DOWN is understandable ... I already grabbed this. However, if I raise my finger, there is no ACTION_UP. After raising the initial click, each one works fine: I can touch the screen, the circle is drawn around the spot instantly, and it will move if I drag my finger, so thereβs no problem.
How do I get the initial message that brought me here that still exists? This should be some kind of API poll, not an event, since I really want the current state, and I know that the event is already pulled in. To be clear, NO events come out of the dispatchTouchEvent () event until I first pull my finger off the screen (even shutting down doesn't create a detectable event).
(I could grab the coordinates from a previous activity and pass it ... but the problem is that the rain can glide over a 10-second waiting period. And I would prefer the activity to be autonomous when doing its job.)
source share