How to prompt the "open with" menu after download a zip file
In my app I download .zip files. Is there a way when those files are downloaded, have a button/notification when clicked prompt the "open with" m开发者_JAVA百科enu with third party compatible apps?
How to do that without knowing which zip handling apps are installed in the user phone?
Also, how to apply to apk files , to prompt app install ?
Intent intent = new Intent();
intent.setAction(android.content.Intent.ACTION_VIEW);
File file = new File(path);
intent.setDataAndType(Uri.fromFile(file), "application/zip");
startActivity(intent);
If you add a button to open the file, it will take care of all of this automatically.
精彩评论