title: Bottom Navigation View not visible in the default fragment Android Studio
body: <p>My bottom navigation bar is not visible in my default start fragment, SearchFragment. If i change the start fragment to another e.g. MoreFragment, it appears on that and all the rest, except the SearchFragment, which is my ideal start fragment.</p>
  
  <p>Here is my code:</p>
  
  <p><strong>Main.java</strong></p>
  
  <pre><code>import android.support.annotation.NonNull;
  import android.support.design.widget.BottomNavigationView;
  import android.os.Bundle;
  import android.support.v4.app.FragmentActivity;
  import android.support.v4.app.FragmentManager;
  import android.view.MenuItem;
  
  
  
  public class Main extends FragmentActivity {
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
      if (savedInstanceState == null) {
             getSupportFragmentManager().beginTransaction().replace(R.id.activity_main, new SearchFragment()).commit();
      }
  
      BottomNavigationView bottomNavigation = (BottomNavigationView) findViewById(R.id.bottom_navigation);
  
      bottomNavigation.setOnNavigationItemSelectedListener(new BottomNavigationView.OnNavigationItemSelectedListener() {
  
          public boolean onNavigationItemSelected(@NonNull MenuItem item) {
              switch(item.getItemId()){
                  case R.id.seach_tab:
                     SearchFragment sf=new SearchFragment();
                      FragmentManager fragmentmanager1=getSupportFragmentManager();
                      fragmentmanager1.beginTransaction()
                              .replace(R.id.activity_main, sf)
                              .commit();
                      break;
  
  
                  case R.id.bookings_tab:
                      BookingsFragment bf=new BookingsFragment();
                      FragmentManager fragmentmanager2=getSupportFragmentManager();
                      fragmentmanager2.beginTransaction()
                              .replace(R.id.activity_main, bf)
                              .commit();
                      break;
  
                  case R.id.account_tab:
                      ProfileFragment pf=new ProfileFragment();
                      FragmentManager fragmentmanager3=getSupportFragmentManager();
                      fragmentmanager3.beginTransaction()
                              .replace(R.id.activity_main, pf)
                              .commit();
                      break;
  
                  case R.id.more_tab:
                     MoreFragment mf=new MoreFragment();
                      FragmentManager fragmentmanager4=getSupportFragmentManager();
                      fragmentmanager4.beginTransaction()
                              .replace(R.id.activity_main, mf)
                              .commit();
                      break;
  
              }
  return false;
          }
  
  
      });
  }
  }
  </code></pre>
  
  <p><strong>activity_main.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:app="http://schemas.android.com/apk/res-auto"
  android:layout_width="match_parent"
  android:id="@+id/activity_main"
  android:layout_height="match_parent"
  android:background="@color/white"&gt;
  
      &lt;android.support.design.widget.BottomNavigationView
          android:id="@+id/bottom_navigation"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_alignParentBottom="true"
          app:itemBackground="@color/white"
          android:layout_gravity="bottom"
          app:itemIconTint="@drawable/tab_bar"
          app:itemTextColor="@drawable/tab_bar"
          app:menu="@menu/bottombarmenu" /&gt;
  
  &lt;/FrameLayout&gt;
  </code></pre>
  
  <p><strong>bottombarmenu.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;menu xmlns:tools="http://schemas.android.com/tools"
  xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:app="http://schemas.android.com/apk/res-auto"&gt;
  &lt;item
      android:title="Search"
      android:enabled="true"
      android:id="@+id/seach_tab"
      android:icon="@drawable/icon_search"
      app:showAsAction="ifRoom|withText"
      &gt;
  
  &lt;/item&gt;
  
  &lt;item
      android:id="@+id/bookings_tab"
      android:enabled="false"
      android:icon="@drawable/icon_bookings"
      android:title="My bookings"&gt;&lt;/item&gt;
  
  &lt;item
      android:title="Profile"
      android:enabled="false"
      android:id="@+id/account_tab"
      android:icon="@drawable/icon_account"
      app:showAsAction="ifRoom|withText"&gt;
  &lt;/item&gt;
  
  &lt;item
      android:id="@+id/more_tab"
      android:enabled="false"
      android:icon="@drawable/icon_more"
      android:title="More"
      app:showAsAction="ifRoom|withText"&gt;&lt;/item&gt;
  
  &lt;/menu&gt;
  </code></pre>