我已經嘗試了我粘貼在下面的代碼..但是這給了我安裝的每個應用程序,但然後我需要檢查每個應用程序是否是我的或不通過檢查包名稱...是有一個代碼,我可以將包名稱傳遞給電話系統,以便它可以根據該包名稱安裝所有應用程序。從軟件包名稱中獲得已安裝的應用程序
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;
}
[基於包名GetInstalled應用]的可能重複(http://stackoverflow.com/questions/14955232/getinstalled-apps-based-on-package-name無恥複製) – 2013-02-19 10:45:03
請不要一再提出同樣的問題。 – 2013-02-19 10:45:14
該帖子已被刪除:( – user1340801 2013-02-19 10:50:50