Android examples for Android OS:Parcel
get Parcel File Descriptor From Uri
//package com.java2s; import java.io.FileDescriptor; import java.io.IOException; import android.content.Context; import android.net.Uri; import android.os.ParcelFileDescriptor; public class Main { public static FileDescriptor getFileDescriptorFromUri(Uri uri, String mode, Context context) throws IOException { ParcelFileDescriptor pfd = context.getContentResolver() .openFileDescriptor(uri, mode); return pfd.getFileDescriptor(); }//from w w w .j a v a 2 s . com }