Package 

Class UriHelper


  • 
    public final class UriHelper
    
                        

    Uri of external storage for Android10 or later may not work properly

    • Method Detail

      • getAbsolutePath

        @Nullable() static String getAbsolutePath(@NonNull() ContentResolver cr, @Nullable() Uri uri)

        convert uri to path

      • getPath

        @Nullable() static String getPath(@NonNull() Context context, Uri uri)

        Return path if the Uri can be converted to a local path

        Parameters:
        context - The context.
        uri - The Uri to query.
      • getDataColumn

        @Nullable() static String getDataColumn(@NonNull() Context context, @NonNull() Uri uri, String selection, Array<String> selectionArgs)

        Get the value of the data column for this Uri. This is useful forMediaStore Uris, and other file-based ContentProviders.

        Parameters:
        context - The context.
        uri - The Uri to query.
        selection - (Optional) Filter used in the query.
        selectionArgs - (Optional) Selection arguments used in the query.
      • isExternalStorageDocument

         static boolean isExternalStorageDocument(@NonNull() Uri uri)
        Parameters:
        uri - The Uri to check.
      • isDownloadsDocument

         static boolean isDownloadsDocument(@NonNull() Uri uri)
        Parameters:
        uri - The Uri to check.
      • isMediaDocument

         static boolean isMediaDocument(@NonNull() Uri uri)
        Parameters:
        uri - The Uri to check.