In the Gmail app, selecting an email from the left fragment opens the email in the right fragment as normal. Rotating the device to portrait shows only the selected email, as you would expect, and rotating the device back to landscape shows both the email list and selected email again. That is all expected and works perfectly.
However, in the API demos and in my application based on the Fragments sample after selecting an item from the left fragment list and it being shown in the right hand fragment, a rotation of the device to portrait shows the list fragment instead of the selected item details fragment like in Gmail. Going back to landscape reveals the selected item again in the righthand fragment.
API Demos Sample code: http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/app/FragmentLayout.html
Any idea how i can recreate that shown in the Gmail app?
Jon O pushed me in the right direction with his answer. Indeed on portrait, the XML only showed the list fragment:
If i changed this to the details fragment however i get a FC as no item from the list has been selected yet. I got around this through placing the code below into my FragmentActivity onCreate method:
Once an item in the list has been selected, the detailsFrame variable points to the View of the fragment. Thus from portrait rotation in the details fragment, to landscape and back again the View remains and is shown correctly.