3

I am trying to navigate to a URL in a browser through the AccessibilityService. I am able to find the URL bar and enter a URL into the EditText, but I can't find a way to press enter to actually go there. There are also no elements on screen for "go" or "enter" other than the suggestions that pop up, but depending on the browser those nodes aren't always clickable.

Is it possible to send a keyboard "enter" key event from an AccessibilityService?

Flyview
  • 1,899
  • 1
  • 28
  • 46
  • Does this answer your question ? https://stackoverflow.com/a/41986130/10831763 – Yakir Malka Jul 03 '20 at 21:58
  • @YakirMalka Unfortunately I don't think so because I don't have an instance of the view, I just have an accessibility node info of the edit text. – Flyview Jul 04 '20 at 04:45

2 Answers2

7

Android R/11 adds this action. It isn't possible on earlier versions. https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.AccessibilityAction#ACTION_IME_ENTER

Phil Weaver
  • 738
  • 3
  • 7
0

No It's not possible on earlier android versions but you can do it on Android 11.

  • 1
    Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jan 30 '23 at 10:22