문제

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?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top