android - How to get right landscape(90° or 270°) Rotation? -
i´m trying right landscape rotation. have done until now:
androidmanifest.xml
android:configchanges="keyboardhidden|orientation"
code handle
@override public void onconfigurationchanged(configuration newconfig) { super.onconfigurationchanged(newconfig); if (newconfig.orientation == configuration.orientation_landscape) { log.i("remodroid", "landscape"); } else if (newconfig.orientation == configuration.orientation_portrait) { log.i("remodroid", "portrait"); // 0 } }
so portrait clear = 0° landscape can 90° or 270°. how find out. im looking smart solution if possible. not want use orientation-/rotationmatrix , oriantation of axis.
do 1 have solution?
you can use display.getorientation()
returns 1 of following:
surface.rotation_0
surface.rotation_90
surface.rotation_180
surface.rotation_270
for me information see android display docs.
Comments
Post a Comment