@Richard C 2. When OrientationChanged fires, it calls a method Session.ShowPage which calls the Show method of iPhoneLandscapePage which in turn causes OrientationChanged to fire again, hence the continuous reloading. This is the problem reported by Wittawat in his original post. It should be easy enough to set a flag to stop the looping.
No, showing a page does not fire the OrientationChanged event - it is (supposed to be) fired by the session in reaction to the physical device orientation changing.
@Richard C 2. If the user connects to the App with the iPhone in landscape orientation then OrientationChanged does fire but Angle is initially reported as 0, and not 90 or -90.
No, then angle is correctly reported at startup. Other factors just made it seem like it wasn't. See the new example project (below).
The problem appears to be that for a new session, OrientationChanged fires before Session.Open and therefore before the session is ready (or something along those lines), and trying to show a page at this point (session first started) causes a new session to be started. And that cycle will continually repeat. Or it may be something else - only the Xojo engineers can tell us for sure. But I do know that trying to show a page from OrientationChanged during it's first execution in a new session is where the problem lies.
The reason it was only happening when in landscape mode is the first line in the OrientationChanged event was skipping the rest of the instructions if the angle didn't appear to have changed. But for a new session, the last saved angle is always going to be zero, so the rest of the instructions do not execute when starting off in portrait. You can make the same bug occur in portrait by removing that first line so that the entire OrientationChanged event runs every time.
The solution (or workaround) is along the lines of what Richard suggested - a flag. I used a flag to prevent the showing of any page from the OrientationChanged event until the session Open event had fired. I also fixed the problem of displaying the correct page no matter which orientation you started in. See the feedback case (Feedback Case #32374) for an updated version of the project that now works (along with logging code that shows the order of the events).