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?
Asked
Active
Viewed 788 times
0

1''
- 26,823
- 32
- 143
- 200
-
By completely ignore rotations, do you mean you want the orientation fixed to either portait or landscape? – James McCracken Jun 10 '13 at 00:38
-
Yes, whatever the default orientation of the device is. – 1'' Jun 10 '13 at 01:07
1 Answers
0
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.

1''
- 26,823
- 32
- 143
- 200