title: "LayoutManager is already attached to a RecyclerView" error
body: <p>I am trying to have multiple RecyclerViews in a layout but I get the following error: "LayoutManager is already attached to a RecyclerView"</p>
  
  <p>The Java code is:</p>
  
  <pre><code>@Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container,
                           Bundle savedInstanceState) {
      // Inflate the layout for this fragment
      View view = inflater.inflate(R.layout.fragment_squad, container, false);
  
      Activity parentActivity = getActivity();
      final ObservableScrollView scrollView = (ObservableScrollView) view.findViewById(R.id.squad_scrollview);
  
      final RecyclerView gkRecyclerView = (RecyclerView) view.findViewById(R.id.gk_recycler);
      final RecyclerView coachRecyclerView = (RecyclerView) view.findViewById(R.id.coach_recycler);
  
      coachRecyclerView.setAdapter(new SquadRecyclerAdapter(parentActivity, getSquadDummyData(0)));
      coachRecyclerView.setLayoutManager(new MyLinearLayoutManager(parentActivity, LinearLayoutManager.VERTICAL, false));
      coachRecyclerView.setHasFixedSize(false);
  
      gkRecyclerView.setAdapter(new SquadRecyclerAdapter(parentActivity, getSquadDummyData(1)));
      gkRecyclerView.setLayoutManager(new MyLinearLayoutManager(parentActivity, LinearLayoutManager.VERTICAL, false));
      gkRecyclerView.setHasFixedSize(false);
  
      scrollView.setTouchInterceptionViewGroup((ViewGroup) parentActivity.findViewById(R.id.container));
  
      if (parentActivity instanceof ObservableScrollViewCallbacks) {
          scrollView.setScrollViewCallbacks((ObservableScrollViewCallbacks) parentActivity);
      }
  
      return view;
  }
  </code></pre>
  
  <p>The XML layout code is:</p>
  
  <pre><code>&lt;com.github.ksoichiro.android.observablescrollview.ObservableScrollView xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:id="@+id/squad_scrollview"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:layout_margin="@dimen/margin_medium"
      &gt;
  
      &lt;LinearLayout
          android:id="@+id/squad_container"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:background="@drawable/seasons_scrollview"
          android:divider="@drawable/nav_bar_divider"
          android:elevation="@dimen/card_elevation"
          android:orientation="vertical"
          android:showDividers="middle"&gt;
  
          &lt;LinearLayout
              android:id="@+id/coach_group"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:orientation="vertical"
              android:paddingBottom="@dimen/margin_small"
              android:paddingLeft="@dimen/margin_standard"
              android:paddingRight="@dimen/margin_standard"
              android:paddingTop="@dimen/margin_small"&gt;
  
              &lt;TextView
                  android:id="@+id/squad_coach_header"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:text="Coach"
                  android:textSize="@dimen/text_size_standard" /&gt;
  
              &lt;android.support.v7.widget.RecyclerView
                  android:id="@+id/coach_recycler"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:paddingTop="@dimen/margin_small"
                  android:paddingBottom="@dimen/margin_small"
                  android:scrollbars="none"&gt;
  
              &lt;/android.support.v7.widget.RecyclerView&gt;
  
          &lt;/LinearLayout&gt;
  
          &lt;LinearLayout
              android:id="@+id/gk_group"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:orientation="vertical"
              android:paddingBottom="@dimen/margin_small"
              android:paddingLeft="@dimen/margin_standard"
              android:paddingRight="@dimen/margin_standard"
              android:paddingTop="@dimen/margin_small"&gt;
  
              &lt;TextView
                  android:id="@+id/squad_gk_header"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:text="Goalkeepers"
                  android:textSize="@dimen/text_size_standard" /&gt;
  
              &lt;android.support.v7.widget.RecyclerView
                  android:id="@+id/gk_recycler"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:paddingTop="@dimen/margin_small"
                  android:paddingBottom="@dimen/margin_small"
                  android:scrollbars="none"&gt;
  
              &lt;/android.support.v7.widget.RecyclerView&gt;
  
          &lt;/LinearLayout&gt;
  
          &lt;LinearLayout
              android:id="@+id/def_group"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:orientation="vertical"
              android:paddingBottom="@dimen/margin_small"
              android:paddingLeft="@dimen/margin_standard"
              android:paddingRight="@dimen/margin_standard"
              android:paddingTop="@dimen/margin_small"&gt;
  
              &lt;TextView
                  android:id="@+id/squad_def_header"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:text="Defense"
                  android:textSize="@dimen/text_size_standard" /&gt;
  
          &lt;/LinearLayout&gt;
  
          &lt;LinearLayout
              android:id="@+id/mid_group"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:orientation="vertical"
              android:paddingBottom="@dimen/margin_small"
              android:paddingLeft="@dimen/margin_standard"
              android:paddingRight="@dimen/margin_standard"
              android:paddingTop="@dimen/margin_small"&gt;
  
              &lt;TextView
                  android:id="@+id/squad_mid_header"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:text="Midfielders"
                  android:textSize="@dimen/text_size_standard" /&gt;
  
          &lt;/LinearLayout&gt;
  
          &lt;LinearLayout
              android:id="@+id/for_group"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:orientation="vertical"
              android:paddingBottom="@dimen/margin_small"
              android:paddingLeft="@dimen/margin_standard"
              android:paddingRight="@dimen/margin_standard"
              android:paddingTop="@dimen/margin_small"&gt;
  
              &lt;TextView
                  android:id="@+id/squad_for_header"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:text="Forwards"
                  android:textSize="@dimen/text_size_standard" /&gt;
  
          &lt;/LinearLayout&gt;
  
  
      &lt;/LinearLayout&gt;
  
  
  &lt;/com.github.ksoichiro.android.observablescrollview.ObservableScrollView&gt;
  </code></pre>
  
  <p>The MyLinearLayoutManager is a custom LinearLayoutManager I found online in order to solve the wrap-content issue of the SDK LinearLayoutManager.</p>
  
  <p>Is there any way I can have multiple RecyclerViews in a single layout? It seems that I cannot attach more than one LayoutManagers per layout.</p>
  
  <p>Any assistance would be very welcome :)</p>