android - How does the API 24 AccessibilityService.dispatchGesture() method work? -


with api 24 got way dispatch gesture device, there no solid documentation or examples out there yet. trying work gesture hitting "oncancelled" callback every time.

here code calls method:

@targetapi(24) private void presslocation(point position){     gesturedescription.builder builder = new gesturedescription.builder();     path p = new path();     p.lineto(position.x, position.y);     p.lineto(position.x+10, position.y+10);     builder.addstroke(new gesturedescription.strokedescription(p, 10l, 200l));     gesturedescription gesture = builder.build();     boolean isdispatched = dispatchgesture(gesture, new gestureresultcallback() {         @override         public void oncompleted(gesturedescription gesturedescription) {             super.oncompleted(gesturedescription);         }          @override         public void oncancelled(gesturedescription gesturedescription) {             super.oncancelled(gesturedescription);         }     }, null);      toast.maketext(fingerprintservice.this, "was dispatched? " + isdispatched, toast.length_short).show(); }` 

has used new method yet or know of example of how functioning?

your path linetos, doesn't specify starting point. try changing first 1 moveto.


Comments