如何解雇系统对话框中的Android? [英] How to dismiss system dialog in Android?
本文介绍了如何解雇系统对话框中的Android?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我要关闭此系统对话框
(附后)。
我得到这个值,但我不能以编程方式在服务关闭它不活动。
我的问题是:
- 是否有可能将其关闭?如果是,请帮助或指导我如何去实现它。
解决方案
请检查
@覆盖
公共无效onWindowFocusChanged(布尔IsTrue运算){
super.onWindowFocusChanged(IsTrue运算);
如果(!IsTrue运算){
意图closeDialog =新的意图(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
sendBroadcast(closeDialog);
}
}
这是工作在我的code。
I have to dismiss this system Dialog
(Attached below).
I am getting this value but I am not able to dismiss it programmatically in Service not in Activity.
My question is:
- Is it possible to dismiss it ? if yes please help or guide me how to achieve it.
解决方案
Please check it
@Override
public void onWindowFocusChanged(boolean isTrue) {
super.onWindowFocusChanged(isTrue);
if (!isTrue){
Intent closeDialog = new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
sendBroadcast(closeDialog);
}
}
It is working in my code.
这篇关于如何解雇系统对话框中的Android?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文