Catch screen rotation BEFORE it happens?

MotoMusher

Active Member
Licensed User
Longtime User
I am running a camera in a panel. If the camera is destroyed without releasing, the camera is locked out until a reboot.

Rotating orientation, causes my panel to disappear, which I am fine with, but camera gets locked.

Is there an event that fires before the rotation? I was hoping for Activity_pause, but that doesn't fire. I can tell if orientation changed, but it is too late then and the camera is toast.

I saw a post about how to do it in a service with a timer, but that doesn't seem real efficient battery wise putting the app in a perpetual loop, and it also detects after the rotation, not before.

thanks.
 

grant1842

Active Member
Licensed User
Longtime User
When an activity is rotated it is paused and then resumed. You can handle releasing the camera on the pause event and re-initializing it on resume.
 
Upvote 0

daemon

Active Member
Licensed User
Longtime User
Is there any way to prevent pause/resume cycle but handle the rotation internally like camera app?
 
Upvote 0
Top