编程语言
首页 > 编程语言> > android-显示通知检查应用程序

android-显示通知检查应用程序

作者:互联网

我想知道是否有一种方法可以取消选中“显示通知”检查,以允许禁用已安装的单个应用程序的通知(Android 4.1).或者,也可以通过“显示”将用户带入特定的系统面板通知”选项.

解决方法:

I would like to know if there is a way to uncheck the “show notifications” check that permits to disable notifications for individual app installed

系统应用程序可以做到这一点.以root用户身份运行的应用可能会入侵其中.否则,这是不可能的.

or alternatively a way to bring the user in the specific system panel with the “show notifications” option for that app

这只是特定应用程序的“设置”屏幕.在许多设备上,您可以显示出来,如https://stackoverflow.com/a/18873867/115145所示:

packageName = "your.package.name.here"

try {
    //Open the specific App Info page:
    Intent intent = new Intent(android.provider.Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
    intent.setData(Uri.parse("package:" + packageName));
    startActivity(intent);

} catch ( ActivityNotFoundException e ) {
    //e.printStackTrace();

    //Open the generic Apps page:
    Intent intent = new Intent(android.provider.Settings.ACTION_MANAGE_APPLICATIONS_SETTINGS);
    startActivity(intent);

}

标签:show,notifications,android
来源: https://codeday.me/bug/20191122/2059429.html