我能够获取已安装或正在运行的应用程序列表。现在我想在列表中检测是否存在任何音乐播放器应用程序?
public void getRunningProcess() {
List<RunningAppProcessInfo> list2 = am.getRunningAppProcesses();
listdp = new ArrayList<DetailProcess>();
for (RunningAppProcessInfo ti : list2) {
if (ti.processName.equals("system") || ti.processName.equals("com.android.phone")) {
continue;
}
DetailProcess dp = new DetailProcess(this, ti);
dp.fetchApplicationInfo(packageinfo);
dp.fetchPackageInfo();
dp.fetchPsRow(pinfo);
if (dp.isGoodProcess()) {
listdp.add(dp);
}
}
Collections.sort(listdp);
adapter = new ProcessListAdapter(this, listdp);
}