title: Black space under action bar
body: <p>I'm trying my to learn basic app design and already made some simple stuff.
  Now I'm getting stuck on the following.</p>
  <ul>
  <li>How to get rid of this blank space underneath the action bar?</li>
  </ul>
  <p><img src="https://i.stack.imgur.com/j2D7B.png" alt="Phone Image" /></p>
  <p>I've tried to hide the action bar but this won't remove the blank space.
  I'm thinking it has something to do with the host fragment but am not sure how to solve this.</p>
  <p>Here is my: <strong>MainActivity.java</strong></p>
  <pre><code>package com.example.mapexplorerv8;
  
  import android.os.Bundle;
  import android.view.Window;
  import android.view.WindowManager;
  
  import com.google.android.material.bottomnavigation.BottomNavigationView;
  
  import androidx.appcompat.app.AppCompatActivity;
  import androidx.navigation.NavController;
  import androidx.navigation.Navigation;
  import androidx.navigation.ui.AppBarConfiguration;
  import androidx.navigation.ui.NavigationUI;
  
  import com.example.mapexplorerv8.databinding.ActivityMainBinding;
  
  public class MainActivity extends AppCompatActivity {
  
      private AppBarConfiguration mAppBarConfiguration;
      private ActivityMainBinding binding;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
  
          //requestWindowFeature(Window.FEATURE_NO_TITLE);
          //this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
          //getSupportActionBar().hide();
  
          binding = ActivityMainBinding.inflate(getLayoutInflater());
          setContentView(binding.getRoot());
  
          BottomNavigationView navView = findViewById(R.id.nav_view);
          // Passing each menu ID as a set of Ids because each
          // menu should be considered as top level destinations.
          AppBarConfiguration appBarConfiguration = new AppBarConfiguration.Builder(
                  R.id.navigation_home, R.id.navigation_map_view, R.id.navigation_notifications)
                  .build();
          NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment_activity_main);
          NavigationUI.setupActionBarWithNavController(this, navController, appBarConfiguration);
          NavigationUI.setupWithNavController(binding.navView, navController);
      }
  
  }
  </code></pre>
  <p><strong>activity_main.xml</strong></p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;androidx.constraintlayout.widget.ConstraintLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
      xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;
      xmlns:tools=&quot;http://schemas.android.com/tools&quot;
      android:id=&quot;@+id/container&quot;
      android:layout_width=&quot;match_parent&quot;
      android:layout_height=&quot;match_parent&quot;
      android:fitsSystemWindows=&quot;true&quot;
      android:paddingTop=&quot;?attr/actionBarSize&quot;&gt;
  
      &lt;com.google.android.material.bottomnavigation.BottomNavigationView
          android:id=&quot;@+id/nav_view&quot;
          android:layout_width=&quot;0dp&quot;
          android:layout_height=&quot;wrap_content&quot;
          android:layout_marginStart=&quot;0dp&quot;
          android:layout_marginEnd=&quot;0dp&quot;
          app:itemTextColor=&quot;@color/white&quot;
          android:background=&quot;@color/black&quot;
          app:itemIconTint=&quot;@color/white&quot;
          app:layout_constraintBottom_toBottomOf=&quot;parent&quot;
          app:layout_constraintLeft_toLeftOf=&quot;parent&quot;
          app:layout_constraintRight_toRightOf=&quot;parent&quot;
          app:menu=&quot;@menu/bottom_nav_menu&quot; /&gt;
  
      &lt;fragment
          android:id=&quot;@+id/nav_host_fragment_activity_main&quot;
          android:name=&quot;androidx.navigation.fragment.NavHostFragment&quot;
          android:layout_width=&quot;match_parent&quot;
          android:layout_height=&quot;match_parent&quot;
          app:defaultNavHost=&quot;false&quot;
          app:layout_constraintBottom_toBottomOf=&quot;@+id/nav_view&quot;
          app:layout_constraintHorizontal_bias=&quot;1.0&quot;
          app:layout_constraintLeft_toLeftOf=&quot;parent&quot;
          app:layout_constraintRight_toRightOf=&quot;parent&quot;
          app:layout_constraintTop_toTopOf=&quot;parent&quot;
          app:layout_constraintVertical_bias=&quot;0.0&quot;
          app:navGraph=&quot;@navigation/mobile_navigation&quot; /&gt;
  
  &lt;/androidx.constraintlayout.widget.ConstraintLayout&gt;
  </code></pre>
  <p><strong>fragment_home</strong></p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;androidx.constraintlayout.widget.ConstraintLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
      xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;
      xmlns:tools=&quot;http://schemas.android.com/tools&quot;
      android:layout_width=&quot;match_parent&quot;
      android:layout_height=&quot;match_parent&quot;
      tools:context=&quot;.ui.home.HomeFragment&quot;&gt;
  
      &lt;TextView
          android:id=&quot;@+id/text_home&quot;
          android:layout_width=&quot;match_parent&quot;
          android:layout_height=&quot;wrap_content&quot;
          android:layout_marginStart=&quot;8dp&quot;
          android:layout_marginTop=&quot;0dp&quot;
          android:layout_marginEnd=&quot;8dp&quot;
          android:textAlignment=&quot;center&quot;
          android:textSize=&quot;20sp&quot;
          android:textColor=&quot;@color/white&quot;
          android:background=&quot;@color/black&quot;
          app:layout_constraintEnd_toEndOf=&quot;parent&quot;
          app:layout_constraintStart_toStartOf=&quot;parent&quot;
          app:layout_constraintTop_toTopOf=&quot;parent&quot; /&gt;
  &lt;/androidx.constraintlayout.widget.ConstraintLayout&gt;
  </code></pre>