调用Android installer 安装和卸载程序
16lz
2021-01-23
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile( new File( "/sdcard/WorldCupTimer.apk")), "application/vnd.android.package-archive");
startActivity(intent); //安装程序
Uri packageURI = Uri.parse( "package:zy.dnh");
Intent uninstallIntent = new Intent(Intent.ACTION_DELETE, packageURI);
startActivity(uninstallIntent); //正常卸载程序
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile( new File( "/sdcard/WorldCupTimer.apk")), "application/vnd.android.package-archive");
startActivity(intent); //安装程序
Uri packageURI = Uri.parse( "package:zy.dnh");
Intent uninstallIntent =
new Intent(Intent.ACTION_DELETE,packageURI);
startActivity(uninstallIntent); //正常卸载程序
intent.setDataAndType(Uri.fromFile( new File( "/sdcard/WorldCupTimer.apk")), "application/vnd.android.package-archive");
startActivity(intent); //安装程序
Uri packageURI = Uri.parse( "package:zy.dnh");
Intent uninstallIntent = new Intent(Intent.ACTION_DELETE, packageURI);
startActivity(uninstallIntent); //正常卸载程序
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile( new File( "/sdcard/WorldCupTimer.apk")), "application/vnd.android.package-archive");
startActivity(intent); //安装程序
Uri packageURI = Uri.parse( "package:zy.dnh");
Intent uninstallIntent =
new Intent(Intent.ACTION_DELETE,packageURI);
startActivity(uninstallIntent); //正常卸载程序