I've a little content provider to open a simple pdf in my app package with an external application, but whe the open() run the parcelfiledescription return me a FileNotFoundException
.
I don't understand what is the right sintax to give the correct file path to the parcel descriptor...
public ParcelFileDescriptor openFile(Uri uri, String mode) {
Log.i("info","eseguo providing");
URI uri1 = URI.create("file:///data/data/package.name/assets/prova.pdf");
File file = new File(uri1);
ParcelFileDescriptor parcel = ParcelFileDescriptor.open(file, ParcelFileDescriptor.MODE_READ_WRITE);
return parcel;
}
Thanks for any help!
i've tried this simple code:
URI uri1 = URI.create("file:///android_asset/prova.pdf");
File file = new File(uri1);
Log.i("info","file exist: " + file.exists());
but it return ever false!