Save current state on rotate.