2

i am trying to fill EditText filed using accessibility service like DashLane or some other apps which are using accessibility Service. i am using an event view focused. when EditText gets focused the event getting started but getSource() returns null.

Code is:

        AccessibilityNodeInfo source = event.getSource();

    if (source != null) {
            ClipboardManager clipboard = (ClipboardManager)  context.getSystemService(Context.CLIPBOARD_SERVICE);
            ClipData clip = ClipData.newPlainText("label", "TEST DATA");
            clipboard.setPrimaryClip(clip);
            source.performAction(AccessibilityNodeInfo.ACTION_PASTE);
            Toast.makeText(MyAccessibilityService.this, "Pasted Successfully", Toast.LENGTH_LONG);
    }

and i tried some of the other methods which is giving errors. so one question here is why its returning null. can anyone pls help me out.

user3546693
  • 364
  • 3
  • 18

0 Answers0