2

I've run into a rather unfortunate problem with an application I'm developing that utilizes an accessibility service to do some special handling of notifications when they arrive on a user's device. The thing is, it works just fine, but the service's 'onAccessibilityEvent' function is never invoked unless the service is restarted from Android's Accessibility page, i.e. I must first enable the service from that page, then disable it, then enable it again in order for 'onAccessibilityEvent' to be called at all.

I've tried using Google's example without making any changes of my own, but even then I still appear to be experiencing the same issue, so I'm not sure what to make of what's going on here. Has anyone run into this problem?

2 Answers 2

2

This happens probably for a android bug as it is solved in newer android version. when you power off onUnbind is called. But on_boot_finished onRebind is not called, so your service remains useless. I have provided my solution to this problem here, please check this out.

Sign up to request clarification or add additional context in comments.

Comments

0

This is because the Service is being killed by the Android framework which requires restarting it from the accessibility menu.

Youcan validate this by adding logs in onDestroy() method

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.