【问题标题】:get info from notificationcompact from package installed从安装包中的 notificationcompact 获取信息
【发布时间】:2021-01-24 02:06:35
【问题描述】:

我需要知道手机上安装的包何时可以发送通知 这里是读取手机上的应用程序的代码,我需要知道它是否通过 NotificationManagerCompat (areNotificationsEnabled ()) 启用了通知

 List<String> paquetenombre = new ArrayList<>();
        Intent intent = new Intent(Intent.ACTION_MAIN,null);
        intent.addCategory(Intent.CATEGORY_APP_MESSAGING);
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED );
     List<ResolveInfo> resolveInfoList = context1.getPackageManager().queryIntentActivities(intent,0);

,提前致谢

【问题讨论】:

    标签: android android-intent notifications android-notifications android-context


    【解决方案1】:

    这是不可能的。应用程序只能使用NotificationManagerCompat.areNotificationsEnabled() 来确定它自己的通知是否被阻止。无法确定是否阻止了另一个应用程序的通知。

    看到这个答案:https://stackoverflow.com/a/39976045/769265

    【讨论】:

    • tks...另一种方法来做到这一点?,我改写问题,如何知道已安装的应用程序是否有权通知
    • 据我所知,无法确定这一点。对不起。
    猜你喜欢
    • 1970-01-01
    • 2019-03-25
    • 1970-01-01
    • 2021-11-28
    • 2021-03-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-01-28
    相关资源
    最近更新 更多