Code example for Context

Methods: getContentResolver

0
        return bMapArray;
    } 
 
    public static int getOrientation(Context context, Uri photoUri) {
        /* it's on the external media. */ 
        Cursor cursor = context.getContentResolver().query(photoUri,
                new String[] { MediaStore.Images.ImageColumns.ORIENTATION }, null, null, null);
 
        if (cursor.getCount() != 1) {
            return -1; 
        } 
 
        cursor.moveToFirst();
        int orientation = cursor.getInt(0);
        cursor.close();
 
        return orientation;
    } 
}