Here you can find the source of adjustCamera(Context context, Camera camera)
public static void adjustCamera(Context context, Camera camera)
//package com.java2s; import android.content.Context; import android.content.res.Configuration; import android.hardware.Camera; public class Main { public static void adjustCamera(Context context, Camera camera) { if (context.getResources().getConfiguration().orientation != Configuration.ORIENTATION_LANDSCAPE) { //parameters.set("orientation","portrait"); camera.setDisplayOrientation(90); } else {/* w ww .j a v a 2s . c o m*/ //parameters.set("orientation","landscape"); camera.setDisplayOrientation(0); } } }