Skip to content
Discussion options

You must be logged in to vote

I found the code using the accessibility service. It looks for event type AccessibilityEvent.CONTENT_CHANGE_TYPE_PANE_DISAPPEARED or AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED.
A quick AI search says these events are only happening after onResume leaving some time for a newly started app to make a connection while the other app is still connected. See android lifecycle here https://www.geeksforgeeks.org/android/activity-lifecycle-in-android-with-demo-app/.

val hasContentChanged =
if (isAtleastP()) {
event.eventType == AccessibilityEvent.CONTENT_CHAN…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@pczern
Comment options

Answer selected by pczern
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant