apk saying something like "There is a problem parsing the package." it could be that you haven't asked for the read/write permission or the file you try to install doesn't exist or is corrupt. ![]() If you get an error while installing the. No Activity found to handle Intent, REQUEST_WRITE_PERMISSION) Now activity.startActivity(install) throws an error Uri apkUri = FileProvider.getUriForFile(AutoUpdate.this,Ä«uildConfig.APPLICATION_ID + ".provider", file) tFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION) New code: Intent install = new Intent(Intent.ACTION_VIEW) Now with Android 24 apparently we are not allowed any more to start intents with file:/// and after some googling it was advised to use A File Provider ![]() ![]() Manager.getMimeTypeForDownloadedFile(downloadId)) Intent install = new Intent(Intent.ACTION_VIEW) My app has an auto-update feature that download an APK and when the download is finished that a Intent.VIEW_ACTION to open the app and let the user install the downloaded apk Uri uri = Uri.parse("file://" + destination)
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |