80,351
社区成员
发帖
与我相关
我的任务
分享
HttpUtils httpUtils = new HttpUtils();
httpUtils.download(mDownloadUrl, path, new RequestCallBack<File>() {
@Override
public void onSuccess(ResponseInfo<File> responseInfo) {
//下载成功(下载过后的放置在sd卡中apk)
Log.i(TAG, "下载成功");
File file = responseInfo.result;
setPermission(file);//按照你的说法并赋予权限,但avd里依然显示-rw-rw
//提示用户安装
installApk(file);
}
}
Intent intent = new Intent("android.intent.action.VIEW");
intent.addCategory("android.intent.category.DEFAULT");
intent.setDataAndType(Uri.fromFile(file),"application/vnd.android.package-archive");
startActivityForResult(intent, 0);