I know this question has been asked many times before, but none of the solutions solved my issue. I have an APK saved on internal memory: "/data/data/[package-name]/files/0.apk" I saved it using:
openFileOutput("0.apk", Context.MODE_WORLD_READABLE);
I want to install it using the following code, but I am getting "There was a problem parsing the package"
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(new File(context.getFilesDir(), "0.apk")), "application/vnd.android.package-archive");
context.startActivity(intent);
And LogCat says, "Parse error when parsing manifest. Discontinuing installation". Please help me solve this problem.
Edit: I decided to use external storage for my file. When I copied my file to the sd card and tried to install it by the above code, everything was alright. But when I downloaded the apk and stored it on sd card, the same "Parse error..." showed up again. At first, I assumed that it's because of a corrupted apk, but when I tried to install it outside my app, it worked.