问题
I have a problem with accessibility service in android. I want to retrive result of USSD command. What I try to do:
- I made an AccessibilityService from gist.github.com/qihnus/1909616
- Deal USSD:
Intent i = new Intent(Intent.ACTION_CALL); i.setData(Uri.parse("tel:*110*10" + Uri.encode("#"))); i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); i.addFlags(Intent.FLAG_FROM_BACKGROUND); startActivity(i);
- Popup window with USSD result opens
- In AccessibilityService onAccessibilityEvent fired, and I get USSD result text. And it works perfectly only when screen is on. If screen is off, onAccessibilityEvent fired only after I unlock the phone.
Is it possible onAccessibilityEvent to be called when screen is off?
Please excuse my bad English, my native language is Ukrainian.
来源:https://stackoverflow.com/questions/23558522/android-accessibilityservice-whan-screen-off