我试图解除断电请求,以便我可以避免Android中的断电请求,但我无法实现此目的。
有人可以帮我解决这个问题吗?
清单文件
<uses-permission android:name="android.permission.DEVICE_POWER" />
<receiver android:name=".PowerRequest">
<intent-filter>
<action android:name="android.intent.action.ACTION_SHUTDOWN" />
</intent-filter>
</receiver>
在收件人中
if (paramIntent.getAction().equals("android.intent.action.ACTION_SHUTDOWN"))
{
//handling to dismiss the System Dialogs. But this is not happening.. Did some thing like
Intent closeDialog = new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
sendBroadcast(closeDialog);
}