I want to write an app to turn auto-rotation on and off automatically depending on which application has focus. I currently have an auto-rotation toggle button on the screen for this purpose (I hate autorotation, but find it useful for a small handful of apps), but I often forget to activite it when starting a relevant app, or to deactivate when I’m done with that app (not to mention it is a pain to have to manually toggle it). I haven’t been able to figure out how to receive a notification when the focused application changes, which I would need to receive to automate the toggle. Is there any way for to be notified whenever the focus changes?
-Harry
This sounds exceedingly difficult. Your background service would be continually polling to see who’s active, and would likely get killed without your knowledge when android needed more memory.. which would be even more frustrating.
Perhaps it would be easier to bind a simple app that toggles the feature to, for instance, a long-touch of the search button.. that way you wouldn’t have to back out to main to toggle it and then go back.
Might be a simpler way.