Search code examples
androidaccessibilityservice

AccessibilityService Event types - Can it be configured dynamically?


I have an app that uses accessibiityService API, and right now I'm configuring it via an xml config file.

The file ofcourse contains the event types I'm interested in, But I wonder if I can set those up in runtime?

If so, can someone show me the way or give a link?


Solution

  • You can use AccessibilityService#getServiceInfo, AccessibilityService#setServiceInfo, and change AccessibilityServiceInfo.eventTypes.