下载并打开PDF格式文件2----用指定的software
用指定的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");<span style="color:#990000;">//The add line to specify the software!!!</span>
i.setComponent(app);
return i;
}
摘自 欧阳天涵的专栏
补充:移动开发 , Android ,