您的位置:首页 > 移动开发 > Android开发

Android:下载并打开PDF格式文件2----用指定的software

2011-11-16 12:18 645 查看
用指定的software来打开PDF格式文件,在我的项目中是用AdobeReader来打开。

So

public Intent getPdfFileIntent(String path){
Intent i = new Intent(Intent.ACTION_VIEW);
i.addCategory(Intent.CATEGORY_DEFAULT);
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK );
Uri uri = Uri.fromFile(new File(path));
i.setDataAndType(uri, "application/pdf");
ComponentName app = new ComponentName("com.adobe.reader", "com.adobe.reader.AdobeReader");//The add line to specify the software!!!
i.setComponent(app);
return i;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐