编程禁用/启用通知 [英] Programmatically disabling/enabling notifications

查看:103
本文介绍了编程禁用/启用通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有一种方法,我可以以编程方式禁用各个项目的通知?我想建立安装设备上的所有程序的列表,然后检查那些我不想从收到通知并点击一个按钮来禁用/启用它们。

Is there a way I can programmatically disable notifications of individual programs? I'd like to build a list of all programs installed on my device then check the ones I don't want to receive notifications from and hit one button to disable/enable them.

我想建立一个应用程序,可以让我实现了一些/与点击一个按钮,所有的通知或者通过点击一个按钮或者一个时间predetermined期结束后重新启用它们。难道Android的支持? NotificationManager似乎不具有这些属性。

I'm trying to build an app that will allow me to enable some/all notifications with a button click and re-enable them via either a button click or after a predetermined period of time. Does Android support that? NotificationManager doesn't seem to have those properties.

推荐答案

这是不可能从其他应用程序禁用通知。你只能控制你自己的应用程序生成的通知。

It is not possible to disable notifications from other apps. you can only control notifications generated by your own app.

<一个href="http://stackoverflow.com/questions/15819249/turn-off-notifications-of-an-app-programatically-on-android">Turn关闭一个应用程序的编程方式在Android

<一个href="http://stackoverflow.com/questions/16019868/android-is-it-possible-to-remove-a-system-managed-notification-programmatically">Android:是否有可能以编程方式删除系统管理的通知?

这篇关于编程禁用/启用通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆