Added handling of state for device rotation to landscape.