Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/201.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何获取android中可发送通知的已安装应用程序列表?_Android_Push Notification_Notifications - Fatal编程技术网

如何获取android中可发送通知的已安装应用程序列表?

如何获取android中可发送通知的已安装应用程序列表?,android,push-notification,notifications,Android,Push Notification,Notifications,我正在开发一个应用程序,在这个程序中,我必须获得一个在android中发送通知的应用程序列表。我找了很多,但没有找到任何解决办法。因此,请告诉我如何获取发送通知的应用程序列表。要获取应用程序列表,您可以这样做 Intent intent = new Intent(Intent.ACTION_MAIN, null); intent .addCategory(Intent.CATEGORY_LAUNCHER); List<ResolveInfo> appList = context.ge

我正在开发一个应用程序,在这个程序中,我必须获得一个在android中发送通知的应用程序列表。我找了很多,但没有找到任何解决办法。因此,请告诉我如何获取发送通知的应用程序列表。

要获取应用程序列表,您可以这样做

Intent intent = new Intent(Intent.ACTION_MAIN, null);
intent .addCategory(Intent.CATEGORY_LAUNCHER);
List<ResolveInfo> appList = context.getPackageManager().queryIntentActivities( intent , 0);
NotificationManagerCompat.from(context).areNotificationsEnabled();