Tag Archives: service

AccessibilityService getRootInActiveWindow() always return null

Questions: I am trying to get the root AccessibilityNodeInfo with getRootInActiveWindow() inside AccessibilitySevice and it always return null. I have added the following meta-data to the manifest: <meta-data android:name=”android.accessibilityservice” android:resource=”@xml/floating_config” /> and the meta-data file is: <?xml version=”1.0″ encoding=”utf-8″?> <accessibility-service xmlns:android=”http://schemas.android.com/apk/res/android” android:accessibilityFeedbackType=”feedbackSpoken” android:accessibilityEventTypes=”typeWindowStateChanged|typeWindowContentChanged” android:accessibilityFlags=”flagIncludeNotImportantViews|flagReportViewIds” android:canRequestFilterKeyEvents=”true” android:canRetrieveWindowContent=”true” android:description=”@string/app_name” android:canRequestTouchExplorationMode=”true” /> What’s wrong? Answers: