Android accessibilityservice whan screen off

独自空忆成欢 提交于 2019-12-10 16:34:37

问题


I have a problem with accessibility service in android. I want to retrive result of USSD command. What I try to do:

  1. I made an AccessibilityService from gist.github.com/qihnus/1909616
  2. 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);
  3. Popup window with USSD result opens
  4. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!