Example usage for org.apache.cordova.api CordovaInterface managedQuery

List of usage examples for org.apache.cordova.api CordovaInterface managedQuery

Introduction

In this page you can find the example usage for org.apache.cordova.api CordovaInterface managedQuery.

Prototype

public abstract Cursor managedQuery(Uri uri, String[] projection, String selection, String[] selectionArgs,
            String sortOrder);

Source Link

Usage

From source file:net.mutina.uclimb.ForegroundCameraLauncher.java

License:Apache License

/**
 * Queries the media store to find out what the file path is for the Uri we supply
 *
 * @param contentUri the Uri of the audio/image/video
 * @param ctx the current applicaiton context
 * @return the full path to the file/*from w  ww  . j ava  2s.co m*/
 */
private String getRealPathFromURI(Uri contentUri, CordovaInterface ctx) {
    String[] proj = { _DATA };
    Cursor cursor = ctx.managedQuery(contentUri, proj, null, null, null);
    int column_index = cursor.getColumnIndexOrThrow(_DATA);
    cursor.moveToFirst();
    return cursor.getString(column_index);
}