Android APK 文件自动安装

1、权限

<uses-permission android:name="android.permission.INSTALL_PACKAGES" />  

 

2、方法

Uri uri = Uri.fromFile(new File("/sdcard/temp.apk")); //这里是APK路径  
Intent intent = new Intent(Intent.ACTION_VIEW);  
intent.setDataAndType(uri,"application/vnd.android.package-archive");  
startActivity(intent);

 

posted @ 2015-06-25 18:30  赵彦军  阅读(477)  评论(0编辑  收藏  举报