【转】在设备(sdcard)上获得apk文件的信息,安装或运行
http://stackoverflow.com/questions/5661418/get-apk-file-icon-version-name
protected void runAppFromApkFileOnSdCard() { final PackageManager pm = this.getPackageManager(); PackageInfo packageInfo = pm.getPackageArchiveInfo(fullPath, 0); Toast.makeText(getApplicationContext(), packageInfo.packageName, Toast.LENGTH_LONG).show();// Intent intent = pm.getLaunchIntentForPackage(packageInfo.packageName);// if( intent == null ){// File file = new File(fullPath);// intent = new Intent();// intent.setAction(Intent.ACTION_VIEW);// intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);// intent.setDataAndType(Uri.fromFile(file),// "application/vnd.android.package-archive");// }// startActivity(intent); }