Jump to content



Android custom orientation handler

  • You cannot reply to this topic
2 replies to this topic

#1 Dr Yap   Members   -  Reputation: 102

Like
0Likes
Like

Posted 21 December 2011 - 01:08 PM

Orientation on an Android device is never nice to look at. I am looking for a way to be able to preferably receive a signal from the OS, or else read it from the sensors, which would tell me that the screen has been rotated. I could then make the transition smoother by rotating the components on the screen instead of Android resetting the graphics device.

Is there a way to receive such a signal and stop Android from handing the orientation change?

I haven't found anything along these lines from my searching but would be grateful for your input and any links you might have.

Ad:

#2 Dr Yap   Members   -  Reputation: 102

Like
1Likes
Like

Posted 24 December 2011 - 06:33 AM

I have found a solution to this by using the manifest file. In the activities tag you need to add

android:configChanges="orientation"
Which means that by overriding onConfigurationChanged in the activity you will receive a notification when the screen is rotated.

#3 compscialien   Members   -  Reputation: 104

Like
0Likes
Like

Posted 12 January 2012 - 05:56 PM

Upon looking it up myself, that seems to be the most widely used solution. While maybe not the most elegant, it certainly gets the job done. This is a good find.






We are working on generating results for this topic
PARTNERS