surfaceview - Android onTouch multi-touch not receiving all touch events -


i using android surfaceview , listening multi-touch events. able detect multiple touches seems action_pointer_up touch event not getting fired. here quick snip of code.

public class gameview extends surfaceview implements runnable {     ...     @override     public boolean ontouchevent(motionevent motionevent) {         log.i("pointer count", integer.tostring(motionevent.getpointercount()));         return true;     }     ... } 

when put 2 fingers on screen pointer count log out 2. if remove 1 of fingers pointer count log out not 1 , stays @ 2. goes 1 if move finger still on screen. why , how firkin fix it? thanks!

edit

this problem occurs on 1 plus 1 , friends samsung galaxy note 2. interesting when put on samsung galaxy s4 problem did not occur.

do not use getaction() == motionevent.action_pointer_up action contain pointer index.

getactionmasked() strip out information, , used comparison.

see http://developer.android.com/reference/android/view/motionevent.html#getactionmasked()


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -