This is kind of silly, but
private void OnButtonClicked(object sender, EventArgs e)
{
Shell.Current.DisplayAlert("Orientaion", DeviceDisplay.Current.MainDisplayInfo.Orientation.ToString(), "OK");
}
always gives "portrait" (with a phone emulator) or "landscape" (with a tablet emulator) even after I switch the orientation. It just gives the default orientation even after the emulator successfully changes it.
What am I missing?
You can recheck if you have enabled option Auto-rotate
on your Android device.
Swipe down on your phone's screen, and then you will find the Auto-rotate
option.