您的位置:首页 > 其它

安装apk出现解析错误

2015-01-19 14:11 232 查看
我遇到该问题的原因是apk存放文件夹的权限,和下载文件本身的权限不够。修改文件夹和文件权限即可
public static void installApp(String filePath){
try {
Process p = Runtime.getRuntime().exec("chmod 777 " + filePath);
p.waitFor();
} catch (Exception e) {
e.printStackTrace();
}
Intent install = new Intent(Intent.ACTION_VIEW);
install.setDataAndType(Uri.fromFile(new File(filePath)),
"application/vnd.android.package-archive");
getActivity().startActivity(install);
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐