title: My fragments keep recreating whenever I reclick or navigate to the next fragment
body: <p>I have implemented the new architecture component on my android app, but unfortunately handling the states of these fragments has become a nightmare for me. Whenever I press the icon of the fragment, the fragment is recreated every time I navigate. How can I handle this or rather save these fragments states?</p>
  
  <p>Here is my main activity handling the five fragments:</p>
  
  <pre><code>public class MainActivityCenterofInformation extends AppCompatActivity {
  
      BottomNavigationView bottomNavigationView;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate (savedInstanceState);
          setContentView (R.layout.activity_maincict);
  
          setUpNavigation ();
      }
  
      public  void setUpNavigation(){
          bottomNavigationView = findViewById (R.id.bottom_nav_cict);
          NavHostFragment navHostFragment = (NavHostFragment)getSupportFragmentManager ()
                  .findFragmentById (R.id.nav_host_fragment_cict);
          NavigationUI.setupWithNavController (bottomNavigationView, navHostFragment.getNavController ());
      }
  
      //adding animations to the fragment
  }
  </code></pre>
  
  <p>I can't read Kotlin so please direct me to Java, thanks.</p>