android 程序更新版本遇到的问题
伊谢尔伦
伊谢尔伦 2017-04-17 13:49:39
0
1
445

通过请求获取了123.apk包,保存在文件中,通过下面的方法去安装的时候提示解析包失败,我去文件夹下面手动安装123.apk可以安装成功,怎么解决。

Intent intent = new Intent(Intent.ACTION_VIEW);

    intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 
    intent.setDataAndType(Uri.fromFile(new File(Environment
    .getExternalStorageDirectory(), "123.apk")),
    "application/vnd.android.package-archive");
    startActivity(intent);
伊谢尔伦
伊谢尔伦

小伙看你根骨奇佳,潜力无限,来学PHP伐。

reply all(1)
阿神

Found it to be a permissions issue.
After checking the information, I found this: fileOutputStream = openFileOutput("YouPaoPao.apk", MODE_WORLD_READABLE);
Write in this form when writing files, and no parsing package errors will be reported when reading and installing.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template