ContentProvider and ParcelFileDescriptor

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

ContentProvider and ParcelFileDescriptor

Postby TommyN » Sat Apr 25, 2009 6:11 pm

Hi!

I've made a ContentProvider where I have overridden the "openFile" function and return a ParcelFileDescriptor. The problem I'm having is that I have to copy the res/raw resources to the file system before I can pass them along using ParcelFileDescriptor.open(file, ParcelFileDescriptor.MODE_READ_ONLY);

Is there a way to share the resources embedde in my ContentProvider without resorting to first copying the resource to disk and doing:

URI uri = URI.create("file:///data/data/<package>/files/myfile");
File file = new File(uri);
return ParcelFileDescriptor.open(file, ParcelFileDescriptor.MODE_READ_ONLY);

Regards,
-Tommy
TommyN
Freshman
Freshman
 
Posts: 3
Joined: Sat Apr 25, 2009 6:02 pm

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: Yahoo [Bot] and 5 guests