title: How to save webview status in bottom navigation bar fragment
body: <p>I'm trying to set 3 webviews in 3 fragments of bottom navigation bar. But when I move fragment to fragment webviews are relading again. How to fix this. I don't want to reload. I want to preserve them.</p>
  
  <p>this is main activity.java</p>
  
  <pre><code>public class MainActivity extends AppCompatActivity {
  private TextView mTextMessage;
  
  private BottomNavigationView.OnNavigationItemSelectedListener mOnNavigationItemSelectedListener
          = new BottomNavigationView.OnNavigationItemSelectedListener() {
  
      Fragment fragment = null;
      @Override
      public boolean onNavigationItemSelected(@NonNull MenuItem item) {
          switch (item.getItemId()) {
              case R.id.navigation_home:
                  fragment = new homeFragment();
                  break;
              case R.id.navigation_dashboard:
                  fragment = new BookmarkFragment();
                  break;
              case R.id.navigation_notifications:
                  fragment = new notificationragment();
                  break;
          }
          return loadFragment(fragment);
      }
  };
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      //loading the default fragment
      loadFragment(new homeFragment());
      BottomNavigationView navView = findViewById(R.id.navigation);
      mTextMessage = findViewById(R.id.message);
      navView.setOnNavigationItemSelectedListener(mOnNavigationItemSelectedListener);
  }
  private boolean loadFragment(Fragment fragment) {
      //switching fragment
      if (fragment != null) {
          getSupportFragmentManager()
                  .beginTransaction()
                  .replace(R.id.fragment_container, fragment)
                  .commit();
          return true;
      }
      return false;
  }
  
  }
  </code></pre>
  
  <p>this is a fragment</p>
  
  <pre><code>public class homeFragment extends Fragment {
  
  WebView webView;
  
  public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
      return inflater.inflate(R.layout.fragment_home, null);
  }
  
  @Override
  public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
      super.onViewCreated(view, savedInstanceState);
  
      webView = getView().findViewById(R.id.web);
      WebSettings webSettings = webView.getSettings();
      webSettings.setJavaScriptEnabled(true);
      webView.loadUrl("https://www.journaldev.com");     
  }
  }
  </code></pre>
  
  <p>please help me.</p>
  
  <p>how to preserve each webview's status.</p>