Gesture clears when orientation changed?

I tried your code in my application and had the same issue. The result of getGesture() is null within onSaveInstanceState, onStop, and onPause, so I'm guessing that the GestureOverlayView is invalidated somewhere between the screen rotation and the calling of those methods.

I tried your code in my application and had the same issue. The result of getGesture() is null within onSaveInstanceState, onStop, and onPause, so I'm guessing that the GestureOverlayView is invalidated somewhere between the screen rotation and the calling of those methods. A workaround is to override onGesturePerformed, assuming your Activity implements OnGesturePerformedListener and you call addOnGesturePerformedListener(this) on your overlay, and save a member instance of the most recent Gesture.

Something like: @Override public void onGesturePerformed(GestureOverlayView overlay, Gesture gesture) { mCurrentGesture = gesture; } Then in your onSaveInstanceState, simply get and package the member instance instead of calling getGesture(). Now setGesture() should work as expected when the Activity recreates itself.

. I'll try to implement this myself – Vicky Kapadia May 12 at 11:30.

When the orientation changes it restarts the activity. You could try restrict the orientation of the app in the manifest file. Android:screenOrientation="portrait.

But I don't want to restrict the orientation. I want to retain the gesture in case of change in orientation. – Vicky Kapadia May 10 at 4:38.

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