The current code below will get the orientation however if the device is in Landscape view and you open the app it shows portrait view. After manual rotating the device it code