Screen Android example source code for developers.
Get orientation of screen.
public int getScreenOrientation() { if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT) { return 1; // Portrait Mode }else if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) { return 2; // Landscape mode } return 0; }