MCPcopy Create free account
hub / github.com/KDE/kid3 / getDataColumn

Method getDataColumn

android/Kid3Activity.java:333–354  ·  view source on GitHub ↗
(Context context, Uri uri, String selection,
                                        String[] selectionArgs)

Source from the content-addressed store, hash-verified

331
332 // Get the value of the data column for this URI.
333 private static String getDataColumn(Context context, Uri uri, String selection,
334 String[] selectionArgs) {
335 String result = null;
336 final String column = "_data";
337 final String[] projection = {column};
338 try {
339 Cursor cursor = context.getContentResolver().query(uri, projection, selection, selectionArgs,
340 null);
341 if (cursor != null) {
342 if (cursor.moveToFirst()) {
343 final int index = cursor.getColumnIndex(column);
344 if (index != -1) {
345 result = cursor.getString(index);
346 }
347 }
348 cursor.close();
349 }
350 } catch (Exception e) {
351 Log.e("Kid3", "Error querying MediaStore data column: " + e.getMessage());
352 }
353 return result;
354 }
355}

Callers 1

getRealPathFromURIMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected