开发者

How to detect and auto-open files of different types?

开发者 https://www.devze.com 2023-02-11 00:14 出处:网络
Let just say I have a PDF and a Doc file on the SD Card -- how do I auto detect which program 开发者_开发知识库to use to open these files?

Let just say I have a PDF and a Doc file on the SD Card -- how do I auto detect which program 开发者_开发知识库to use to open these files?

Is this even possible at all?


You could use an Intent with application/pdf.

Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(pathToPdf, "application/pdf");
0

精彩评论

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