Get The Name Of The App Using Accessibility Service In Android
I'm working in Accessibility Service. i need to get the app name using Accessibility Service. i have studied the documentation of the Accessibility Service in developer's of Androi
Solution 1:
You can't get the "app name" of the application. At least not reliably. The strings that the app reads out are things like the title of the Title Bar, or the string underneath the apps icon. It never actually directly asks the framework for the title of the app it is attached to.
You do, however, have access to the application package.
someAccessibilityNodeInfo.getPackageName();
This uniquely identifies the application that a given AccessibilityNodeInfo was sent from.
You could also consider using this:
someAccessibilityService.getRootInActiveWindow();
And crawl down the view hierarchy looking for a title bar.
Post a Comment for "Get The Name Of The App Using Accessibility Service In Android"