intent 方式 安装指定apk

  安装指定apk

public void setupAPK(String apkname){
String fileName
= Environment.getExternalStorageDirectory() + " / " + apkname;
Intent intent
= new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(
new File(fileName)), " application/vnd.android.package-archive " );
mService.startActivity(intent);
}

你可能感兴趣的:(intent 方式 安装指定apk)