title: Navigation Component Lifecycle
body: <p>I have been trying out Navigation Component for a while now but somehow not getting the reason (or explanation) behind current Lifecycle of Navigation Component. Here are some points that needs clarification.</p>
  <h3>1. Fragment to Fragment flow</h3>
  <p>In navigation Component every fragment (or lets say page) is recreated every time it is visited (or revisited). So, when you are at <code>A</code> and go to <code>B</code>, <code>A</code> is destroyed and later when you go back to <code>A</code> (like pressing back button) <code>A</code> is created from stretch.</p>
  <p>In a traditional Activity patterns when you go back to <code>A</code> it just goes to <code>onResume</code> as it wasn't destroyed when moving to <code>B</code>. Any reason that this pattern is changed in Navigation Component?</p>
  <p>The problem of recreating is when you have a lot of data and it takes time to get redrawn and it feels like app is freezing. An example would be simple HomePage (say Facebook NewsFeed). Preserving data can be handled with <code>ViewModel</code> but drawing of all of the feeds again require time and it will freeze.</p>
  <p>There is another problem that recreation generates. Assume this scenario: <code>A</code> has an <code>Collapsing AppBar</code> with a <code>NestedScrollView</code>. User scrolls down and <code>AppBar</code> will collapse and then user moves to a different page <code>B</code>. When he comes back to <code>A</code> it will be redrawn and <code>AppBar</code> is expanded. I am not sure if it is a bug or I should do something to fix it? So any solution here is also welcomed.</p>
  <h3>2. Activity recreation</h3>
  <p>If activity is recreated for certain reasons like orientation change, every page in Navigation Component gets recreated until current destination. Although <code>onCreate</code> method of Fragment not <code>onCreateView</code> is getting called, I don't see a point of creating Fragments in Activity recreation. Any explanation would be welcomed.</p>