0
我需要打开PDF。我知道这个过程,这是我的代码:Android Open PDF意图
string file_path = _path + url.Substring (5);
if (System.IO.File.Exists(file_path)) {
Android.Net.Uri pdfFile = Android.Net.Uri.FromFile (new Java.IO.File (file_path));
Intent pdfIntent = new Intent (Intent.ActionView);
pdfIntent.SetDataAndType (pdfFile, "application/pdf");
pdfIntent.SetFlags (ActivityFlags.NoHistory);
_parent.StartActivity (pdfIntent);
return true;
}
我使用Xamarin,以及存在的路径,因为我检查一下,你可以看到。 该应用程序打开Adobe Reader,但是当它启动时出现一条错误消息,说明(文件未找到)。所以,我的文件是
/data/data/com.myapp/files/.hide/contents/file_test.pdf
是否有一定的权限设置?我真的不明白为什么它无法打开我的文件!