-
public final class UriHelperUri of external storage for Android10 or later may not work properly
-
-
Field Summary
Fields Modifier and Type Field Description public final static Array<String>STANDARD_DIRECTORIES
-
Method Summary
Modifier and Type Method Description static StringgetAbsolutePath(@NonNull() ContentResolver cr, @Nullable() Uri uri)convert uri to path static booleanisStandardDirectory(@NonNull() String dir)static StringgetPath(@NonNull() Context context, Uri uri)Return path if the Uri can be converted to a local path static StringgetDataColumn(@NonNull() Context context, @NonNull() Uri uri, String selection, Array<String> selectionArgs)Get the value of the data column for this Uri. static booleanisExternalStorageDocument(@NonNull() Uri uri)static booleanisDownloadsDocument(@NonNull() Uri uri)static booleanisMediaDocument(@NonNull() Uri uri)static booleanisGooglePhotosUri(@NonNull() Uri uri)-
-
Method Detail
-
getAbsolutePath
@Nullable() static String getAbsolutePath(@NonNull() ContentResolver cr, @Nullable() Uri uri)
convert uri to path
-
isStandardDirectory
static boolean isStandardDirectory(@NonNull() String dir)
-
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.
-
isGooglePhotosUri
static boolean isGooglePhotosUri(@NonNull() Uri uri)
-
-
-
-