Has anyone implemented accessibility service? I have a requirement where in I need to know when home key is pressed from a service. I am wondering if AccessbilityService is the solution .unfortunately there are not many tutorials on the same ? Any code examples available?
accessibility service in android?
557 views Asked by Preethi At
2
There are 2 answers
0
On
Accessbility service can be used , if you know the home package( which can be inferred from logcat) then event is generated when user goes to home screen
NOTE : But the user has to explicitly set the Settings -> Accessibilty ->Check the application name .
There is another way to know when the home screen is invoked , from service . Start reading the logs to know when home intent was sent though i am not sure whether it is the right way .
You cannot determine when home button is pressed...