i have app used outdoors, in conditions. these on rooted b&n nook tablets running android 2.1. have optical touch detection, not pressure, large raindrop on screen can "disable" device, because it's being detected press, , other presses not detected.
part one: in activity being used, manually detect long (10 second) screen presses, consistent raindrop beginning blocking press. use dispatchtouchevent() , it's fine.
part two: open new activity , circle rain drop , tell user "wipe rain drop". new activity opens fine, , can draw circles anywhere please.
the trouble new activity not receive touch events first press... long press hasn't stopped yet. not getting "new" action_down understandable... grabbed that. if lift finger though, there's no action_up either. after lifting initial press, every works fine: can tap screen, instantly circle drawn around spot, , move if drag finger, no problems there.
how initial press, 1 brought me here, still exists? must sort of polling api, not event, since want current state , know event sucked up. clear, no events coming out of dispatchtouchevent() until first take finger off screen (even off not create detectable event).
(i could grab coordinates prior activity , pass it... trouble there rain drop slide around during 10 second wait period. , rather activity self contained in doing job.)
i'm not sure can (although i've never tried). i'm pretty sure touch events canceled out new activity opened.
the approach may decide instead either use framgents api or open new view on top of view that's being touched.
the view that's receiving touch events continue until 1 of these events happen:
the method
ontouchevent()returnsfalse. if returnsfalse@ point, stop receiving touch events together. meaning, if returnfalsein action_move action, not receive action_up action.you receive action_cancel denotes gesture has ended. means touch left view bounds, number of reasons.
you receive action_up means last touching finger lifted view.
views in receive touch events long views in front return false actions default. if pop new view on top of view that's recording touches, keep recording , pass draw coordinates top view.
Comments
Post a Comment