title: RecyclerView inside Fragment from TabBar
body: <p>I got a small problem.</p>
  
  <p>I tried to load a recycler view with some card.</p>
  
  <p>Without the recycler view the fragment works and I got the card displayed, but since I added the recyclerView I keep getting error about it.</p>
  
  <blockquote>
    <p>FATAL EXCEPTION: main
                                                                               Process: com.example.pierre.all, PID: 1729
                                                                               android.view.InflateException: Binary XML file line #24: RecyclerView
    has no LayoutManager
                                                                                   at android.view.LayoutInflater.inflate(LayoutInflater.java:539)
                                                                                   at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
                                                                                   at
    com.example.pierre.all.Categories$PlaceholderFragment.onCreateView(Categories.java:131)
                                                                                   at
    android.support.v4.app.Fragment.performCreateView(Fragment.java:1974)
                                                                                   at
    android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1067)
                                                                                   at
    android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1252)
                                                                                   at
    android.support.v4.app.BackStackRecord.run(BackStackRecord.java:742)
                                                                                   at
    android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1617)
                                                                                   at
    android.support.v4.app.FragmentManagerImpl.executePendingTransactions(FragmentManager.java:570)
                                                                                   at
    android.support.v4.app.FragmentPagerAdapter.finishUpdate(FragmentPagerAdapter.java:141)
                                                                                   at android.support.v4.view.ViewPager.populate(ViewPager.java:1177)
                                                                                   at
    android.support.v4.view.ViewPager.setCurrentItemInternal(ViewPager.java:608)
                                                                                   at
    android.support.v4.view.ViewPager.setCurrentItemInternal(ViewPager.java:570)
                                                                                   at
    android.support.v4.view.ViewPager.setCurrentItem(ViewPager.java:551)
                                                                                   at
    android.support.design.widget.TabLayout$ViewPagerOnTabSelectedListener.onTabSelected(TabLayout.java:2008)
                                                                                   at
    android.support.design.widget.TabLayout.selectTab(TabLayout.java:1025)
                                                                                   at
    android.support.design.widget.TabLayout.selectTab(TabLayout.java:995)
                                                                                   at
    android.support.design.widget.TabLayout$Tab.select(TabLayout.java:1272)
                                                                                   at
    android.support.design.widget.TabLayout$TabView.performClick(TabLayout.java:1377)
                                                                                   at android.view.View$PerformClick.run(View.java:21147)
                                                                                   at android.os.Handler.handleCallback(Handler.java:739)
                                                                                   at android.os.Handler.dispatchMessage(Handler.java:95)
                                                                                   at android.os.Looper.loop(Looper.java:148)
                                                                                   at android.app.ActivityThread.main(ActivityThread.java:5417)
                                                                                   at java.lang.reflect.Method.invoke(Native Method)
                                                                                   at
    com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
                                                                                   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)</p>
  </blockquote>
  
  <p>This is my fragment_categories_favorites.xml</p>
  
  <pre><code>&lt;FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  tools:context="layout.Categories_favorites"&gt;
  
  &lt;android.support.v7.widget.RecyclerView
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:id="@+id/list"
  android:scrollbars="vertical"&gt;
  
      &lt;android.support.v7.widget.CardView
          xmlns:card_view="http://schemas.android.com/apk/res-auto"
          android:id="@+id/card_view"
          android:layout_width="120dp"
          android:layout_height="120dp"
          card_view:cardCornerRadius="4dp"
          android:background="@drawable/background"&gt;
  
          &lt;TextView
              android:id="@+id/info_text"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:text="SHOP"
              android:textSize="20sp"
              android:gravity="center" /&gt;
  
          &lt;TextView
              android:id="@+id/info_text2"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:text="25 items"
              android:layout_marginTop="40dp"
              android:gravity="center"
              android:textSize="12sp"
              /&gt;
      &lt;/android.support.v7.widget.CardView&gt;
      &lt;/android.support.v7.widget.RecyclerView&gt;
      &lt;/FrameLayout&gt;
  </code></pre>
  
  <p>My Categories_favorites.java</p>
  
  <pre><code>public class Categories_favorites extends Fragment {
  
      private static final String TAG = "RecyclerViewFragment";
  
      public Categories_favorites() {
          // Required empty public constructor
      }
  
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container,
                               Bundle savedInstanceState) {
          View rootView = inflater.inflate(R.layout.fragment_categories_favorites, container, false);
          rootView.setTag(TAG);
  
          RecyclerView rv = (RecyclerView) rootView.findViewById(R.id.list);
          LinearLayoutManager manager = new LinearLayoutManager(getActivity());
          manager.setOrientation(LinearLayoutManager.VERTICAL);
          rv.setLayoutManager(manager);
          //I tried this before instead of the 3 lignes before.
          //rv.setLayoutManager(new LinearLayoutManager(getActivity()));
          rv.setAdapter(new MyAdapter());
          return rootView;
  
      }
  }
  </code></pre>
  
  <p>And this is MyAdaptater.java</p>
  
  <pre><code>public class MyAdapter extends RecyclerView.Adapter&lt;MyAdapter.MyViewHolder&gt; {
  
      private final List&lt;Pair&lt;String, String&gt;&gt; characters = Arrays.asList(
              Pair.create("Lyra Belacqua", "Brave, curious, and crafty, she has been prophesied by the witches to help the balance of life"),
              Pair.create("Pantalaimon", "Lyra's daemon, nicknamed Pan."),
              Pair.create("Roger Parslow", "Lyra's friends"),
              Pair.create("Lord Asriel", "Lyra's uncle"),
              Pair.create("Marisa Coulter", "Intelligent and beautiful, but extremely ruthless and callous."),
              Pair.create("Iorek Byrnison", "Armoured bear, Rightful king of the panserbjørne. Reduced to a slave of the human village Trollesund."),
              Pair.create("Serafina Pekkala", "Witch who closely follows Lyra on her travels."),
              Pair.create("Lee Scoresby", "Texan aeronaut who transports Lyra in his balloon. Good friend with Iorek Byrnison."),
              Pair.create("Ma Costa", "Gyptian woman whose son, Billy Costa is abducted by the \"Gobblers\"."),
              Pair.create("John Faa", "The King of all gyptian people.")
      );
  
      @Override
      public int getItemCount() {
          return characters.size();
      }
  
      @Override
      public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
          LayoutInflater inflater = LayoutInflater.from(parent.getContext());
          View view = inflater.inflate(R.layout.fragment_categories_favorites, parent, false);
          return new MyViewHolder(view);
      }
  
      @Override
      public void onBindViewHolder(MyViewHolder holder, int position) {
          Pair&lt;String, String&gt; pair = characters.get(position);
          holder.display(pair);
      }
  
      public class MyViewHolder extends RecyclerView.ViewHolder {
  
          private final TextView name;
          private final TextView description;
  
          private Pair&lt;String, String&gt; currentPair;
  
          public MyViewHolder(final View itemView) {
              super(itemView);
  
              name = ((TextView) itemView.findViewById(R.id.info_text));
              description = ((TextView) itemView.findViewById(R.id.info_text2));
  
              itemView.setOnClickListener(new View.OnClickListener() {
                  @Override
                  public void onClick(View view) {
                      new AlertDialog.Builder(itemView.getContext())
                              .setTitle(currentPair.first)
                              .setMessage(currentPair.second)
                              .show();
                  }
              });
          }
  
          public void display(Pair&lt;String, String&gt; pair) {
              currentPair = pair;
              name.setText(pair.first);
              description.setText(pair.second);
          }
      }
  
  }
  </code></pre>
  
  <p>What I have done wrong ?
  (sorry for my english too)</p>
  
  <p>Thanks in advance</p>