开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜