Is there anyway to find out if a device is portrait or landscape by default? In that I mean how you normally use the device.
Most phones have a portrait screen for
I am not sure if this will help but this is a quick example I wrote that will show you how to have a listener...which will allow you to figure out which orientation you are in.
...textviewOrientation = (TextView)findViewById(R.id.textView1);
myOrientationEventListener = new OrientationEventListener(this,
SensorManager.SENSOR_DELAY_NORMAL){
@Override
public void onOrientationChanged(int arg0) {
textviewOrientation.setText("Orientation: " + String.valueOf(arg0));
myOrientationEventListener.enable();
if ((arg0 < 100) || (arg0 > 280)){
setRequestedOrientation(
ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
} else {
setRequestedOrientation(
ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
}
}
};...
...@Override
protected void onDestroy() {
// TODO Auto-generated method stub
super.onDestroy();
myOrientationEventListener.disable();
}...