Android Context Get getOrientation(Context context, Uri photoUri)

Here you can find the source of getOrientation(Context context, Uri photoUri)

Description

get Orientation

Declaration

public static int getOrientation(Context context, Uri photoUri) 

Method Source Code

//package com.java2s;
import android.content.Context;
import android.database.Cursor;

import android.net.Uri;

import android.provider.MediaStore;

public class Main {
    public static int getOrientation(Context context, Uri photoUri) {
        /* it's on the external media. */
        Cursor cursor = context//from  w  w w. ja  v  a  2  s .  com
                .getContentResolver()
                .query(photoUri,
                        new String[] { MediaStore.Images.ImageColumns.ORIENTATION },
                        null, null, null);

        if (cursor.getCount() != 1) {
            return -1;
        }

        cursor.moveToFirst();
        return cursor.getInt(0);
    }
}

Related

  1. getMobilityVersion(Context context)
  2. getMusesAppContext()
  3. getNameFromUri(Context context, Uri uri)
  4. getOffset(Context context)
  5. getOpenGLESVersion(final Context context)
  6. getPackageName(final Context context)
  7. getPackageVersion(Context c)
  8. getPackageVersionAsInt(Context c)
  9. getPath(Context context, Uri uri)