title: Android | Navigation Graph | Orientation Change | Fragment not retained
body: <p><strong>General:</strong>
  I have my app consisting of the activity and several fragments. I am using the Navigation Graph to move through the various fragments. I have the ability to rotate the device and therefore have different layouts.</p>
  <p><strong>Problem:</strong>
  I know from fragment A I go to fragment B and I rotate the phone, I go back to fragment A</p>
  <p><strong>First partial solution:</strong></p>
  <p>From the documentation I took what could have been the solution, which however turned out to be only a partial solution. in fact I read that to prevent problems during rotation I could use the following parameters:</p>
  <pre><code>        android:configChanges=&quot;orientation|screenSize|screenLayout|keyboardHidden&quot;
  </code></pre>
  <p>This would seem to solve the rotation problem but it creates a new one: landscape layouts are not updated to the size they should have.
  How can I completely remedy the problem?
  It doesn't matter if you need to get your hands dirty in the code or just add another parameter in the manifest, I would like to understand what is wrong</p>
  <p>Example:
  bottom navigation -&gt; TabA (entrypoint);
  TabB,
  TabC.</p>
  <p>I click on Tab B -&gt; then clicking inside I will go to fragment B1 (from corrent tab B). So I rotate phone and I will go again to Tab B instead fragment B1</p>