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

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -