How to save state with navigation drawer and fragments
<p>I have an application with a navigation drawer, one activity and many fragments. When I change the device orientation my main activity is recreate and it's my main fragment who appears, not the current fragment. Just like when I launch the app.</p>

<p>How can I restore the current fragment and maybe the data associated with the selected fragment ?</p>

<p>I Have seen this post but it doesn't work : <a href="https://stackoverflow.com/questions/19448946/save-fragment-state-with-navigation-drawer">Save fragment state with navigation drawer</a></p>

<p>Thanks in advance to those who can help me.</p>