1

I wrote some native code to make use of Android's performGlobalAction() method, following the instructions from this Stackoverflow answer.

However, required action does not happen -- all the 'chain' to performGlobalAction() works as intended, as I checked using console logs, but the exact action is called but doesn't work, despite I gave Accessibility permission for the app in phone's settings.

Maybe that's because Flutter doesn't currently supports Android Accessibility methods? Who can enlighten me on this topic?

emvaized
  • 884
  • 12
  • 23

1 Answers1

0

AccessibilityService work with only android widgets it cannot be used for any other type widget (for e.g css and flutter widgets). However if you want to click somewhere you can using the method below:

  protected void clickAt(int x, int y) {
    Path path = new Path();
    path.moveTo(x, y);
    GestureDescription.Builder builder = new GestureDescription.Builder();
    GestureDescription gestureDescription = builder
        .addStroke(new GestureDescription.StrokeDescription(path, 10, 10))
        .build();
    getService().dispatchGesture(gestureDescription, null, null);
}