Android, how to not destroy the activity when I rotate the device?

Add android:configChanges="orientation to your Activity in AndroidManifest.xml. This way your Activity won't be restarted automatically. See the documentation for more infos.

Add android:configChanges="orientation" to your Activity in AndroidManifest.xml. This way your Activity won't be restarted automatically. See the documentation for more infos.

The activity is restarted again. I don't know what's the point of doing all the stuff that has to be done when the activity rotates, even if it is not rotating virtually. Is there a way to disable that messages that the sensor sends to the OS about the rotation, or something like that, to fix this problem from its root?

– TheMatrix Jul 27 '10 at 0:56 1 on what device are you programming? Remember, that for example sliding out the keyboard could also restart your activity... (if that's the reason set confChanges to "keyboard|keyboarddden|orientation") – flurin Jul 27 '10 at 17:29.

Look at this code in Floating Image. It has the most interesting way of handling screen rotation ever. code.google.com/p/floatingimage/source/b....

I have an app that works only in portrait mode, and I have made the changes in my manifest file for every activity the orientation to be portrait. But when I rotate the device, the activity recreates again. How to not destroy the activity?

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions