title: Floating Action Button null when inside a coordinatorlayout
body: <p>I have a FAB inside a coordinatorlayout. The objective was put a FAB anchor to a appbar that have a bottom navigation view as child, but the FAB just don't appear on screen and return a null object on class. The coordinatorlayout is in the same scope of a FragmentContainerView, and I guess that view is conflicting with the coordinatorlayout;</p>
  <p>here is my XML code:</p>
  <pre><code>&lt;RelativeLayout 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;
      android:background=&quot;@color/white&quot;
      tools:context=&quot;Main.Main_Screen&quot;
      &gt;
  
      &lt;androidx.fragment.app.FragmentContainerView
          android:id=&quot;@+id/main_frag_container&quot;
          android:layout_width=&quot;match_parent&quot;
          android:layout_height=&quot;match_parent&quot;
          android:name=&quot;androidx.navigation.fragment.NavHostFragment&quot;
          app:defaultNavHost=&quot;true&quot;
          app:navGraph=&quot;@navigation/nav_graph_main&quot;
          /&gt;
  
      &lt;androidx.coordinatorlayout.widget.CoordinatorLayout
          android:layout_width=&quot;match_parent&quot;
          android:layout_height=&quot;86dp&quot;
          android:layout_alignParentBottom=&quot;true&quot;&gt;
          &lt;com.google.android.material.bottomappbar.BottomAppBar
              android:id=&quot;@+id/main_bottom_bar&quot;
              android:layout_width=&quot;match_parent&quot;
              android:layout_height=&quot;wrap_content&quot;
              android:layout_gravity=&quot;bottom&quot;
              android:backgroundTint=&quot;@color/Laranja&quot;&gt;
  
              &lt;com.google.android.material.bottomnavigation.BottomNavigationView
                  android:id=&quot;@+id/main_nav_view&quot;
                  android:layout_width=&quot;match_parent&quot;
                  android:layout_height=&quot;wrap_content&quot;
                  android:layout_marginEnd=&quot;16dp&quot;
                  android:background=&quot;@color/Transparente&quot;
                  android:outlineSpotShadowColor=&quot;@color/Transparente&quot;
                  app:itemIconTint=&quot;@color/white&quot;
                  app:itemTextColor=&quot;@color/white&quot;
                  app:menu=&quot;@menu/main_menu&quot; /&gt;
          &lt;/com.google.android.material.bottomappbar.BottomAppBar&gt;
  
          &lt;com.google.android.material.floatingactionbutton.FloatingActionButton
              android:id=&quot;@+id/fab_fast_sync&quot;
              android:layout_width=&quot;wrap_content&quot;
              android:layout_height=&quot;wrap_content&quot;
              android:backgroundTint=&quot;@color/white&quot;
              android:src=&quot;@drawable/icones&quot;
              app:backgroundTint=&quot;@color/Azul&quot;
              app:borderWidth=&quot;0.7dp&quot;
              app:layout_anchor=&quot;@id/main_bottom_bar&quot;
              app:maxImageSize=&quot;38dp&quot;
              app:tint=&quot;@null&quot;
              /&gt;
      &lt;/androidx.coordinatorlayout.widget.CoordinatorLayout&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  <p>Below is the snippet where I am trying to instance a variable of the FAB:</p>
  <pre><code>fab_fast_sync = findViewById(R.id.fab_fast_sync);
  fab_fast_sync.setOnClickListener(this); //returns a error by null object reference
  </code></pre>
  <p>I made a test on other project and its works perfectly fine without the FragmentContainerView, and reading the documentation about coordinatorlayout on developer.android I am clueless about my mistakes here. Any help would be appreciated.</p>