如何在Android中获取预安装的启用/禁用应用程序列表

时间:2013-08-19 09:01:22

标签: android

//我已经安装了应用列表但是如何获得预先安装的应用启用/禁用列表?

PackageManager packageManager = getPackageManager();
List<PackageInfo> packageList = packageManager.getInstalledPackages(PackageManager.GET_PERMISSIONS);
String installedAppName=null;
String installedAppPackageName=null;
String installedVersion=null;
for(int i=0;i<packageList.size();i++){
PackageInfo packageInfo = (PackageInfo) packageList.get(i);
installedAppName =  (String) getPackageManager().getApplicationLabel(                       packageInfo.applicationInfo);
installedAppPackageName = packageInfo.packageName;
installedVersion = packageInfo.versionName;
                                    if(installedAppPackageName.equals("com.android.chrome")){
                                        Log.i("installedAppPackageName", installedAppPackageName);
Log.i("installedVersion", installedVersion);
Log.i("Found", "FOUND");

break;
}
}

0 个答案:

没有答案