Is it possible simple to detect current orientation of android device, without programming a listener and handling the position matrix?
In my app I want only to know current orientation – vertical or horizontal – at the moment. However I don’t want to listen to events of axiometry or other events.
Is it possible simple to detect current orientation of android device, without programming a
Share
Use the
getRotationmethod:From the documentation:
Keep in mind that
getRotationwas introduced from Android 2.2. UsegetOrientationif your target are older devices.