getDataColumn

fun Context.getDataColumn(uri: Uri, selection: String?, selectionArgs: Array<String>?): String?

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

Return

The value of the _data column, which is typically a file path.

Parameters

uri

The Uri to query.

selection

(Optional) Filter used in the query.

selectionArgs

(Optional) Selection arguments used in the query.