I have created a folder layout-land where I have put a modified copy of my main.xml layout (modified to display the layout in landscape). So I have main.xml in res/layout and modified main.xml in res/layout-land.
When I rotate the phone in landscape before running my app, the good activity is displayed (same for vertical), but if I rotate while running the app, the activity “disappear” and the home screen is displayed…
This only on main.xml, not on preferences screen (when I rotate, the screen rotate).
It’s not a FC: activity is still running in background no, app is killed by me!
I have found the problem : when I rotate the screen, void onDestroy is called. In that void, I kill the process, that’s why the app ends (in fact I was wrong, the app doesn’t continue in background, process is killed by me).
And I have found some answers in stackoverflow to avoid execute everything in onCreate after screen rotation.
Thanks