Saturday, 17 October 2015

How to find Android default screen orientation.

as i tried for the requirement of my personal project for getting default screen orientation.

i got the very simple solution taking int value

int orient=this.getResources().getConfiguration().orientation;

it will give the result either 1 or 2

1 is portrait and 2 is landscape

No comments:

Post a Comment