如何解雇系统对话框中的Andr​​oid?对话框中、系统、oid、Andr

2023-09-05 06:01:18 作者:择以年

我要关闭此系统对话框(附后)。 我得到这个值,但我不能以编程方式在服务关闭它不活动。

我的问题是:

     是否有可能将其关闭?如果是,请帮助或指导我如何去实现它。   

解决方案

请检查

  @覆盖
公共无效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.