title: How to add a recyclerView inside another recyclerView
body: <p>I'm planning to develop an app that shows some dynamic data inside a <code>recyclerCardView</code>. So i decided add a <code>recyclerView</code> called <code>CheckBoxRecyclerView</code>
  inside my main <code>recyclerView</code>. This is my code for my app :</p>
  
  <p>My Main Activity :</p>
  
  <pre><code>setContentView(R.layout.activity_startup);
  Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
  reminderView = (RecyclerView) findViewById(R.id.reminder_recycler_view);
  RlayoutManager = new LinearLayoutManager(this);
  reminderView.setLayoutManager(RlayoutManager);
  
  setSupportActionBar(toolbar);
  cardView = (CardView) findViewById(R.id.card_first);
  cardView.setOnClickListener(new View.OnClickListener() {
      @Override
      public void onClick(View v) {
          Intent intent = new Intent(getApplicationContext() , ReminderActivity.class);
          startActivity(intent);
      }
  });
  ReminderHelper helper = new ReminderHelper(getApplicationContext());
  ReminderAdapter reminderAdapter = new ReminderAdapter(helper);
  ContentValues reminderValues = new ContentValues();
  ContentValues checkboxValues = new ContentValues();
  // Devlopment Part -&gt;
  reminderValues.put("reminderTitle" , "A Reminder Title");
  reminderValues.put("reminderLastModDate" , 0);
  reminderValues.put("reminderAlarm" , 0);
  reminderValues.put("reminderPicURI" , "skjshksjh");
  reminderValues.put("ReminderBackground" , "#00796b");
  checkboxValues.put("checkboxText" , "This is a CheckBox");
  checkboxValues.put("isDone" , false);
  checkboxValues.put("checkboxReminderID" , 0);
  reminderAdapter.INSERT_REMINDER(reminderValues);
  reminderAdapter.INSERT_CHECKBOX(checkboxValues);
  File dbPath = getApplicationContext().getDatabasePath(ReminderHelper.DATABASE_NAME);
  if(dbPath.exists()){
      List&lt;Reminder&gt; reminders = new ReminderAdapter(helper).getAllReminders();
      List&lt;CheckBoxItem&gt; checkBoxItems = new ReminderAdapter(helper).getAllCheckBoxes();
      RAdapter = new RAdapter(reminders , getApplicationContext() , checkBoxItems);
      reminderView.setAdapter(RAdapter);
  }else{
  
  }
  </code></pre>
  
  <p>And it's layout file :</p>
  
  <pre><code>&lt;LinearLayout 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:orientation="vertical"
      android:paddingBottom="8dp"
      android:paddingLeft="8dp"
      android:paddingRight="8dp"
      android:paddingTop="8dp"
      app:layout_behavior="@string/appbar_scrolling_view_behavior"
      tools:context="com.smflog.sreminder.StartupActivity"
      tools:showIn="@layout/app_bar_startup"&gt;
  
      &lt;android.support.v7.widget.RecyclerView
          android:layout_width="match_parent"
          android:id="@+id/reminder_recycler_view"
          android:scrollbars="vertical"
          android:layout_height="match_parent"&gt;
  </code></pre>
  
  <p>and inside this recyclerView there is another:</p>
  
  <pre><code>&lt;android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:card_view="http://schemas.android.com/apk/res-auto"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:id="@+id/reminder_card"
      card_view:cardCornerRadius="2dp"
      card_view:cardElevation="4dp"
      card_view:cardUseCompatPadding="true"&gt;
  
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:orientation="vertical"
          android:paddingBottom="16dp"
          android:paddingLeft="8dp"&gt;
  
          &lt;com.smflog.sreminder.utils.TitleView
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:id="@+id/reminder_title"
              android:paddingTop="8dp"
              android:text="Wellcome To Google Keep !"
              android:textSize="15dp"
              android:textStyle="bold" /&gt;
          &lt;LinearLayout
              android:layout_width="wrap_content"
              android:layout_height="wrap_content" android:orientation="horizontal"&gt;
  &lt;android.support.v7.widget.RecyclerView
      android:layout_width="wrap_content"
      android:id="@+id/checkbox_recycler_view"
      android:layout_height="wrap_content"&gt;
  
  &lt;/android.support.v7.widget.RecyclerView&gt;
          &lt;/LinearLayout&gt;
  
      &lt;/LinearLayout&gt;
  &lt;/android.support.v7.widget.CardView&gt;
  </code></pre>
  
  <p>Their adapters, Main ( RAdapter ) :</p>
  
  <pre><code>public class RAdapter extends RecyclerView.Adapter&lt;RAdapter.ViewHolder&gt; {
      List&lt;Reminder&gt; reminder;
      private Context context;
      private LinearLayoutManager lln;
      private CAdapter checkBoxAdapter;
      private List&lt;CheckBoxItem&gt; checkBoxItems;
      public static class ViewHolder extends RecyclerView.ViewHolder {
          public CardView rCardView;
          public RecyclerView recyclerView;
          public TitleView rTitleView;
          public ViewHolder(View itemView) {
              super(itemView);
              rCardView = (CardView) itemView.findViewById(R.id.reminder_card);
              rTitleView = (TitleView) itemView.findViewById(R.id.reminder_title);
              recyclerView = (RecyclerView) itemView.findViewById(R.id.checkbox_recycler_view);
          }
      }
  
      public RAdapter(List&lt;Reminder&gt; reminder, Context context, List&lt;CheckBoxItem&gt; checkBoxItems) {
          this.reminder = reminder;
          this.context = context;
          this.checkBoxItems = checkBoxItems;
      }
  
      @Override
      public RAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
          View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.reminder_card, parent, false);
          ViewHolder vh = new ViewHolder(v);
          return vh;
      }
  
      @Override
      public void onBindViewHolder(RAdapter.ViewHolder holder, int position) {
          lln = new LinearLayoutManager(context);
          holder.recyclerView.setLayoutManager(lln);
          checkBoxAdapter = new CAdapter(checkBoxItems, context);
          holder.recyclerView.setAdapter(checkBoxAdapter);
          holder.rCardView.setCardBackgroundColor(Color.parseColor("#00796b"));
          holder.rTitleView.setText(reminder.get(position).getReminderTitle());
      }
  
      @Override
      public int getItemCount() {
          return reminder.size();
      }
  }
  </code></pre>
  
  <p>And second Adapter :</p>
  
  <pre><code>public class CAdapter extends RecyclerView.Adapter&lt;CAdapter.ViewHolder&gt; {
      List&lt;CheckBoxItem&gt; checkBoxItems;
      Context context;
  
      public static class ViewHolder extends RecyclerView.ViewHolder {
          public TitleView checkBoxTitle;
          public ImageView deleteCheckBox;
          public CheckBox checkBoxCheckBox;
  
          public ViewHolder(View itemView) {
              super(itemView);
              checkBoxTitle = (TitleView) itemView.findViewById(R.id.checkbox_item_text);
              checkBoxCheckBox = (CheckBox) itemView.findViewById(R.id.checkbox_item_checkbox);
              Log.d("CAdapterLog", "Adpater Holded !!!!! :( ");
              deleteCheckBox = (ImageView) itemView.findViewById(R.id.btn_delete_checkbox);
          }
      }
  
      public CAdapter(List&lt;CheckBoxItem&gt; checkBoxItems, Context context) {
          this.checkBoxItems = checkBoxItems;
          this.context = context;
          Log.d("CAdapterLog", "Adpater Created !!!!! :( ");
      }
  
  
      @Override
      public CAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
          View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.checkbox_item, parent, false);
          ViewHolder vh = new ViewHolder(v);
          Log.d("CAdapterLog", "Adpater ViewHolded :( !!!!! :( ");
          return vh;
      }
  
      @Override
      public void onBindViewHolder(CAdapter.ViewHolder holder, int position) {
          Boolean isCheckboxChecked = Boolean.parseBoolean(checkBoxItems.get(position).getCheckBoxIsDone());
          String checkBoxText = checkBoxItems.get(position).getCheckBoxBody();
          Log.d("CAdapterLog", "Adpater Binded :( ");
          final int checkboxID = Integer.parseInt(checkBoxItems.get(position).getCheckBoxID());
          int reminderCheckBoxID = Integer.parseInt(checkBoxItems.get(position).getCheckBoxReminderID());
          holder.deleteCheckBox.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  Log.d("CAdapterLog", "Cross Button Clicked !");
              }
          });
          holder.checkBoxCheckBox.setChecked(isCheckboxChecked);
          holder.checkBoxTitle.setText(checkBoxText);
      }
  
      @Override
      public int getItemCount() {
          return checkBoxItems.size();
      }
  
  }
  </code></pre>
  
  <p><strong>And my problem:</strong> as you see in CAdapter, only constructor's <strong>Log</strong> message displayed.</p>
  
  <p><strong>UPDATE</strong>: if there is another way to display some dynamic data inside another dynamic card if yes is it better to use it instead of recyclerView?<br>
  anyone help me?<br>
  The output : <a href="https://i.stack.imgur.com/3ZJlY.png" rel="noreferrer">Application output</a>
  as you see just the setTitle for RAdapter works.</p>