I am new to android and I am trying to explore the AccessibilityService. I have extended the AccessibilityService class, which gets the AccessibilityEvents and I am able to use the events.
I see a problem when I run "uiautomator dump". My AccessibilityService gets destroyed and I do not get any Accessibility Events. Is there a way to work around this problem?
Any help or suggestion appreciated. Thank you very much in advance.
The stack trace is attached below:
W/System.err( 3832): at com.example.myservice.MyAccessibilityService.onUnbind(MyAccessibilityService.java:185)
W/System.err( 3832): at android.app.ActivityThread.handleUnbindService(ActivityThread.java:2629)
W/System.err( 3832): at android.app.ActivityThread.access$1800(ActivityThread.java:141)
W/System.err( 3832): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1348)
W/System.err( 3832): at android.os.Handler.dispatchMessage(Handler.java:99)
W/System.err( 3832): at android.os.Looper.loop(Looper.java:137)
W/System.err( 3832): at android.app.ActivityThread.main(ActivityThread.java:5103)
W/System.err( 3832): at java.lang.reflect.Method.invokeNative(Native Method)
W/System.err( 3832): at java.lang.reflect.Method.invoke(Method.java:525)
W/System.err( 3832): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
W/System.err( 3832): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
W/System.err( 3832): at dalvik.system.NativeStart.main(Native Method)
UiAutomator can't be used along with an AccessibilityService. When you turn on the service the uiAutomator will crash.
However, as UiAutomator 2.0 is based on instrumentation you will probably be able to access the information you need without the service.