src/main/java/de/blau/android/util/FileUtil.java
/**
     * Try to convert a content Uri to a file Uri (will handle file uris gracefully)
     * 
     * @param ctx Android Context
     * @param uri the content Uri
     * @return the converted Uri or null
     */
Try to convert a content Uri to a file Uri (will handle file uris gracefully)

@param ctx Android Context
@param uri the content Uri
@return the converted Uri or null
Try to convert a content Uri to a file Uri ( will handle file uris gracefully ) @param ctx Android Context @param uri the content Uri @return the converted Uri or null
@Nullable
    public static Uri contentUriToFileUri(@NonNull Context ctx, @NonNull Uri uri) {
        String path = ContentResolverUtil.getPath(ctx, uri);
        if (path != null) {
            return Uri.parse(FILE_SCHEME_PREFIX + path);
        }
        return null;
    }
@ Nullable public static Uri contentUriToFileUri ( @ NonNull Context ctx , @ NonNull Uri uri ) { String path = ContentResolverUtil . getPath ( ctx , uri ) ; if ( path != null ) { return Uri . parse ( FILE_SCHEME_PREFIX + path ) ; } return null ; }
Try to convert a content Uri to a file Uri (will handle file uris gracefully)
Try to convert a content Uri to a file Uri ( will handle file uris gracefully )