从notificationcompact获取信息,该信息来自已安装的软件包

时间:2020-10-09 00:42:56

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

我需要知道手机上安装的软件包何时可以发送通知,这里是读取手机上应用程序的代码,我需要知道它是否通过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);

,在此先感谢

1 个答案:

答案 0 :(得分:0)

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

查看此答案:https://stackoverflow.com/a/39976045/769265

相关问题