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
是否有一定的權限設置?我真的不明白爲什麼它無法打開我的文件!