我已经尝试了我在下面粘贴的代码..但这给了我安装的每个应用程序但是我需要通过检查包名称来检查每个应用程序是否是我的...是否有一个代码可以传递给我将包名称添加到电话系统,以便它为我提供基于该包名称安装的所有应用程序。
PackageManager manager = getPackageManager();
Intent mainIntent = new Intent(Intent.ACTION_MAIN, null);
mainIntent.addCategory(Intent.CATEGORY_DEFAULT);
final List<ResolveInfo> apps = manager.queryIntentActivities(mainIntent, 0);
Collections.sort(apps, new ResolveInfo.DisplayNameComparator(manager));
ArrayList<String> oArrInstalledHomeApps = new ArrayList<String>();
if (apps != null)
{
final int count = apps.size();
for (int i = 0; i < count; i++)
{
ResolveInfo info = apps.get(i);
String strpackageName = info.activityInfo.applicationInfo.packageName;
if(strpackageName.contains ("com.ZZ."))
{
oArrInstalledHomeApps.add(strpackageName);
}
}
return oArrInstalledHomeApps;
}