I have an app that builds a listView of all the pdfs in a specified folder already located on the android machine. The file path and name are stored in an array called files[] and I can grab a full path with files[e.Position]. Here is my c# code
public void documentListView_ItemClick(object sender, AdapterView.ItemClickEventArgs e)
{
var bytes = File.ReadAllBytes(files[e.Position]);
Android.Net.Uri pdfPath = Android.Net.Uri.Parse(files[e.Position]);
Intent intent = new Intent(Intent.ActionView);
intent.SetDataAndType(pdfPath, "application/pdf");
intent.SetFlags(ActivityFlags.NewTask);
StartActivity(intent);
}
I have also added this to my manifest
<uses-persmission android:name="android.permissions.READ_EXTERNAL_STORAGE" />
<uses-persmission android:name="android.permissions.WRITE_EXTERNAL_STORAGE" />
Every time i click the button it starts to open adobe(which is great) and then it says "this file could not be accessed".
However, I can open the file directly by going to the folder. Any Ideas?