开发者

How to prompt the "open with" menu after download a zip file

开发者 https://www.devze.com 2023-03-22 21:20 出处:网络
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?

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消