Android examples for android.hardware:Camera Rotation
get Display Rotation via Display
import android.content.Context; import android.view.Display; import android.view.WindowManager; public class Main { static int getDisplayRotation(Context context) { final WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE); final Display display = wm.getDefaultDisplay(); return display.getRotation(); }/*from w ww .j a v a2 s .com*/ }