I\'m trying to temporarily lock the orientation of the Android device, where most of the time it changes with the sensor. So what I want to do is figure out what the current
I'm not exactly sure what your problem is. Are you trying to determine if a device is currently oriented in landscape or portrait mode? If so you can get that information quickly with:
Display display = ((WindowManager) context.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
Point size = new Point();
Display.getSize(size);
boolean isLandscape = size.x > size.y;
If you couple that with Display.getOrientation()
you should have access to all the information you need.