使用程序包名称检查为特定应用程序启用的通知

时间:2018-12-03 19:46:06

标签: java android listview android-notifications android-context

我已在Android手机中使用已安装的应用程序实现了listView。我想知道特定应用程序notification listViewon clicking的状态。我已经使用NotificationManagerCompat类来检查活动通知,但是我无法传递在context上单击的应用程序的listView,因为我只能得到{{1} }。

这是我的方法:

package info

在这里,private boolean getActiveNotification(){ List<AppList> res = new ArrayList<>(); List<PackageInfo> packs = getPackageManager().getInstalledPackages(0); boolean flag = false; for (int i=0; i< packs.size(); i++){ PackageInfo p = packs.get(i); if(!NotificationManagerCompat.from(p).areNotificationsEnabled()){ flag = false; } else { flag = true; } } return flag; } 是一个以AppListPOJO作为其字段的name

我将在icon内部的getInstalledApps()方法中实现onCreate函数。

因此,如何从特定应用的listView.setOnItemClickListener()context中的package infoname中提取rowItem

下面是我的listView的屏幕截图: enter image description here

0 个答案:

没有答案