Code example for Uri

Methods: querygetPathgetSchemetoString

        public String type;
    public static FileInfo getFileInfoFromURI(Context aContext, Uri uri) throws IllegalArgumentException {
        FileInfo info = new FileInfo();
        if (uri.getScheme().equals("file")) {
            info.path = uri.getPath();
            return info;
        if (uri.toString().startsWith("content://org.openintents.filemanager/")) {
            // Work around URI escaping brokenness 
            info.path = uri.toString().replaceFirst("content://org.openintents.filemanager", "");
            return info;
        Cursor cursor = aContext.getContentResolver().query(uri, null, null, null, null);
        int dataIdx = cursor.getColumnIndex(MediaStore.Images.Media.DATA);
        if (dataIdx != -1)
Connect your IDE to all the code out there  Get Codota for Java