Question

In one activity implementing SurfaceHolder.Callback, I include the line android:configChanges="keyboardHidden|orientation|screenSize" to stop the activity from being redrawn when, among other things, the screen is rotated. However, surfaceChanged() still gets called when the screen is rotated. Is this intentional, and how can I get the behaviour I want, which is to completely ignore rotations?

Was it helpful?

Solution

It seems like there's no better solution than a manual hack: set a boolean variable once surfaceChanged is called for the first time (i.e. when the surface is created), and return at the beginning of surfaceChanged if this variable is set.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top