this has been by far the most impressive, practical and simple tip I've read so far. It completely solves the need to using p.setscreenorientation() with the collateral damage of android killing the activity!!!!
What perfect control over any desired prescribed screen orientation this is...