Android 从安装的软件包的notificationcompact获取信息

Android 从安装的软件包的notificationcompact获取信息,android,android-intent,notifications,android-notifications,android-context,Android,Android Intent,Notifications,Android Notifications,Android Context,我需要知道手机上安装的软件包何时可以发送通知这里是读取手机上应用程序的代码,我需要知道它是否通过NotificationManagerCompat(areNotificationsEnabled())启用了通知 List paquetenombre=newarraylist(); 意图=新意图(Intent.ACTION\u MAIN,空); intent.addCategory(intent.CATEGORY\u APP\u消息); intent.setFlags(intent.FLAG_AC

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

List paquetenombre=newarraylist();
意图=新意图(Intent.ACTION\u MAIN,空);
intent.addCategory(intent.CATEGORY\u APP\u消息);
intent.setFlags(intent.FLAG_ACTIVITY_NEW_TASK | intent.FLAG_ACTIVITY_RESET_TASK_,如果需要);
List resolveInfoList=context1.getPackageManager().QueryInputActivities(intent,0);

,提前感谢

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


请参阅以下答案:

tks。。。另一种方法?我重新表述了这个问题,如何知道安装的应用程序是否具有通知权限?据我所知,这是不可能确定的。很抱歉
 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);