I know how to lock an activity in a specific orientation (in AndroidManifest.xml):
I know how to lock to a specific orientation programmatically:
But, how do I lock the activity to the orientation in which started at? e.g., if it started portrait, it should stick to that.
getResources().getConfiguration().orientation when your app starts, then programmatically set the orientation like you do above. The method will return either