title: why BottomSheetBehavior in androidx error The view is not a child of CoordinatorLayout?
body: <p>I use <code>androidx</code> and material Bottom Sheet Modal persistent. but my code is error like this :</p>
  
  <p><code>The view is not a child of CoordinatorLayout</code></p>
  
  <p>bottom_sheet.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      android:id="@+id/bottom_sheet"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:background="#fff"
      android:orientation="vertical"
      app:behavior_hideable="false"
      app:behavior_peekHeight="72dp"
      app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior"&gt;
  
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:orientation="horizontal"
          android:layout_gravity="center_vertical"
          android:weightSum="3"&gt;
  
          &lt;TextView
              android:layout_width="0dp"
              android:layout_height="wrap_content"
              android:layout_marginBottom="@dimen/activity_margin"
              android:layout_weight="2"
              android:text="Order Details"
              android:textColor="#444"
              android:textSize="18dp"
              android:textStyle="bold" /&gt;
  
          &lt;TextView
              android:layout_width="0dp"
              android:gravity="right"
              android:layout_height="wrap_content"
              android:layout_weight="1"
              android:textStyle="bold"
              android:textSize="15dp"
              android:text="₹435.00"&gt;&lt;/TextView&gt;
      &lt;/LinearLayout&gt;
  
  
      &lt;TextView
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="Chicken Fried Rice 1x1" /&gt;
  
      &lt;TextView
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="Paneer Tikka 1x2" /&gt;
  
      &lt;TextView
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_marginTop="@dimen/activity_margin"
          android:text="Delivery Address"
          android:textColor="#444"
          android:textStyle="bold" /&gt;
  
      &lt;TextView
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="Flat No 404, Skyline Apartments, Vizag - 500576" /&gt;
  
      &lt;Button
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_marginTop="30dp"
          android:background="#000"
          android:foreground="?attr/selectableItemBackground"
          android:text="PROCEED PAYMENT"
          android:textColor="#fff" /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>activity_main.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:background="#efefef"
      tools:context="com.app.MainActivity"&gt;
  
      &lt;include layout="@layout/content_main" /&gt;
  
      &lt;!-- Adding bottom sheet after main content --&gt;
      &lt;include layout="@layout/bottom_sheet" /&gt;
  
  &lt;/androidx.constraintlayout.widget.ConstraintLayout&gt;
  </code></pre>
  
  <p>MainActivity.java</p>
  
  <pre><code>package com.app;
  
  import android.os.Bundle;
  import android.util.Log;
  import android.view.View;
  import android.view.Menu;
  import android.view.MenuItem;
  import android.widget.Button;
  import android.widget.LinearLayout;
  import android.widget.RelativeLayout;
  
  import androidx.annotation.NonNull;
  import androidx.appcompat.app.AppCompatActivity;
  
  import com.google.android.material.bottomsheet.BottomSheetBehavior;
  
  import butterknife.BindView;
  import butterknife.ButterKnife;
  import butterknife.OnClick;
  
  public class MainActivity extends AppCompatActivity {
  
      private static final String TAG = MainActivity.class.getSimpleName();
  
      @BindView(R.id.btn_bottom_sheet)
      Button btnBottomSheet;
  
      @BindView(R.id.bottom_sheet)
      LinearLayout layoutBottomSheet;
  
      BottomSheetBehavior sheetBehavior;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
          ButterKnife.bind(this);
  
  //        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
  //        setSupportActionBar(toolbar);
  
          sheetBehavior = BottomSheetBehavior.from(layoutBottomSheet);
  
          /**
           * bottom sheet state change listener
           * we are changing button text when sheet changed state
           * */
          sheetBehavior.setBottomSheetCallback(new BottomSheetBehavior.BottomSheetCallback() {
              @Override
              public void onStateChanged(@NonNull View bottomSheet, int newState) {
                  switch (newState) {
                      case BottomSheetBehavior.STATE_HIDDEN:
                          break;
                      case BottomSheetBehavior.STATE_EXPANDED: {
                          btnBottomSheet.setText("Close Sheet");
                      }
                      break;
                      case BottomSheetBehavior.STATE_COLLAPSED: {
                          btnBottomSheet.setText("Expand Sheet");
                      }
                      break;
                      case BottomSheetBehavior.STATE_DRAGGING:
                          break;
                      case BottomSheetBehavior.STATE_SETTLING:
                          break;
                  }
              }
  
              @Override
              public void onSlide(@NonNull View bottomSheet, float slideOffset) {
  
              }
          });
      }
  
      /**
       * manually opening / closing bottom sheet on button click
       */
      @OnClick(R.id.btn_bottom_sheet)
      public void toggleBottomSheet() {
          if (sheetBehavior.getState() != BottomSheetBehavior.STATE_EXPANDED) {
              sheetBehavior.setState(BottomSheetBehavior.STATE_EXPANDED);
              btnBottomSheet.setText("Close sheet");
          } else {
              sheetBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED);
              btnBottomSheet.setText("Expand sheet");
          }
      }
  }
  </code></pre>
  
  <p>where I wrong, and how to solve this, I already google about this problem, but I got no clue.</p>
  
  <p>error in <code>sheetBehavior = BottomSheetBehavior.from(layoutBottomSheet);</code></p>
  
  <p>thanks</p>