title: BottomSheetBehavior is not a child of CoordinatorLayout
body: <p>this is my XML layout with name songlist :</p>
  
  <p><a href="https://i.stack.imgur.com/sPjx6.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/sPjx6.jpg" alt="enter image description here"></a> </p>
  
  <pre><code>&lt;android.support.design.widget.CoordinatorLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      android:layout_width="match_parent"
      android:layout_height="match_parent"&gt;
  
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:orientation="vertical"&gt;
  
          &lt;LinearLayout
              android:id="@+id/viewA"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:layout_weight="0.6"
              android:background="@android:color/holo_purple"
              android:orientation="horizontal"/&gt;
  
          &lt;android.support.v4.widget.NestedScrollView
              android:id="@+id/bottom_sheet"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:background="@android:color/holo_blue_bright"
              app:layout_behavior="android.support.design.widget.BottomSheetBehavior"
              &gt;
              &lt;LinearLayout
                  android:layout_width="match_parent"
                  android:layout_height="match_parent"&gt;
                  &lt;ListView
                      android:id="@+id/list"
                      android:layout_width="match_parent"
                      android:layout_height="308dp"
                      /&gt;
              &lt;/LinearLayout&gt;
  
          &lt;/android.support.v4.widget.NestedScrollView&gt;
      &lt;/LinearLayout&gt;
      &lt;android.support.design.widget.FloatingActionButton
          android:id="@+id/fab"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_margin="16dp"
          android:clickable="true"
          android:src="@drawable/personlog"
          app:layout_anchor="@id/viewA"
          app:layout_anchorGravity="bottom|center"/&gt;
  
  &lt;/android.support.design.widget.CoordinatorLayout&gt;
  </code></pre>
  
  <p>and this is my fragment which contain this layout :</p>
  
  <pre><code>public class SongList extends Fragment {
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
  
          View view = inflater.inflate(R.layout.songlist,container,false);
  
          textView=(TextView)view.findViewById(R.id.txt);
  
          View bottomSheet = view.findViewById(R.id.bottom_sheet);
          BottomSheetBehavior bottomSheetBehavior = BottomSheetBehavior.from(bottomSheet);
          bottomSheetBehavior.setPeekHeight(200);
  return view;}
  }
  </code></pre>
  
  <p>but when lunch the app give me this error :</p>
  
  <pre><code>java.lang.IllegalArgumentException: The view is not a child of CoordinatorLayout
  </code></pre>
  
  <p>from this line :</p>
  
  <pre><code>  BottomSheetBehavior bottomSheetBehavior = BottomSheetBehavior.from(bottomSheet);
  </code></pre>
  
  <p>how can fix this ? seems all things work fine but give that error ... if any one can please help</p>