title: how to open same activity with different data when click on card view
body: <p>I have created one horizontal recycle view with card view. I have created single card and shown it multiple times in the recycle view. The data has been shown from the web services. Now what here is the UI of app</p>
  
  <p><a href="https://i.stack.imgur.com/bAIWx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bAIWx.png" alt="enter image description here"></a></p>
  
  <p>Now what i have to do is when i click on any card then one activity should open. I have created one activity, that activity should get open when i click on any card. And base on the card data, the data should be change in the activity.</p>
  
  <pre><code>public class RecyclerViewDataAdapter extends RecyclerView.Adapter&lt;RecyclerViewDataAdapter.ItemRowHolder&gt; {
  
  private List&lt;Data&gt; dataList;
  private Context mContext;
  
  public RecyclerViewDataAdapter(Context context, List&lt;Data&gt; dataList) {
      this.dataList = dataList;
      this.mContext = context;
  }
  
  @Override
  public ItemRowHolder onCreateViewHolder(ViewGroup viewGroup, int i) {
      View v = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.list_item, null);
      ItemRowHolder mh = new ItemRowHolder(v);
      return mh;
  }
  
  @Override
  public void onBindViewHolder(ItemRowHolder itemRowHolder, int i) {
  
      final String sectionName = dataList.get(i).getTitle();
  
      List singleSectionItems = dataList.get(i).getSection();
  
      itemRowHolder.itemTitle.setText(sectionName);
  
      SectionListDataAdapter itemListDataAdapter = new SectionListDataAdapter(mContext, singleSectionItems);
  
      itemRowHolder.recycler_view_list.setHasFixedSize(true);
      itemRowHolder.recycler_view_list.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.HORIZONTAL, false));
      itemRowHolder.recycler_view_list.setAdapter(itemListDataAdapter);
  
  
       itemRowHolder.recycler_view_list.setNestedScrollingEnabled(false);
  
  
     /*  itemRowHolder.recycler_view_list.setOnTouchListener(new View.OnTouchListener() {
          @Override
          public boolean onTouch(View v, MotionEvent event) {
              int action = event.getAction();
              switch (action) {
                  case MotionEvent.ACTION_DOWN:
                      // Disallow ScrollView to intercept touch events.
                      v.getParent().requestDisallowInterceptTouchEvent(true);
                      break;
                  case MotionEvent.ACTION_UP:
                      //Allow ScrollView to intercept touch events once again.
                      v.getParent().requestDisallowInterceptTouchEvent(false);
                      break;
              }
              // Handle RecyclerView touch events.
              v.onTouchEvent(event);
              return true;
          }
      });*/
  
      itemRowHolder.btnMore.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
  
  
              Toast.makeText(v.getContext(), "click event on more, "+sectionName , Toast.LENGTH_SHORT).show();
  
  
  
          }
      });
  
  
  
  
  
  
  
     /* Glide.with(mContext)
              .load(feedItem.getImageURL())
              .diskCacheStrategy(DiskCacheStrategy.ALL)
              .centerCrop()
              .error(R.drawable.bg)
              .into(feedListRowHolder.thumbView);*/
  }
  
  @Override
  public int getItemCount() {
      return (null != dataList ? dataList.size() : 0);
  }
  
  public class ItemRowHolder extends RecyclerView.ViewHolder {
  
      protected TextView itemTitle;
  
      protected RecyclerView recycler_view_list;
  
      protected Button btnMore;
  
  
  
      public ItemRowHolder(View view) {
          super(view);
  
          this.itemTitle = (TextView) view.findViewById(R.id.itemTitle);
          this.recycler_view_list = (RecyclerView) view.findViewById(R.id.recycler_view_list);
          this.btnMore= (Button) view.findViewById(R.id.btnMore);
  
  
      }
  
  }
  </code></pre>
  
  <p>}</p>
  
  <p>another class</p>
  
  <pre><code>public class SectionListDataAdapter extends RecyclerView.Adapter&lt;SectionListDataAdapter.SingleItemRowHolder&gt; {
  
  private List&lt;Section&gt; itemsList;
  private Context mContext;
  
  
  
  public SectionListDataAdapter(Context context, List&lt;Section&gt; itemsList) {
      this.itemsList = itemsList;
      this.mContext = context;
  }
  
  @Override
  public SingleItemRowHolder onCreateViewHolder(ViewGroup viewGroup, int i) {
      View v = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.list_single_card, null);
      SingleItemRowHolder mh = new SingleItemRowHolder(v);
      return mh;
  }
  
  @Override
  public void onBindViewHolder(SingleItemRowHolder holder, int i) {
  
      Section singleItem = itemsList.get(i);
  
      holder.tvTitle.setText(singleItem.getName());
  
  
  
  }
  
  @Override
  public int getItemCount() {
      return (null != itemsList ? itemsList.size() : 0);
  }
  
  public class SingleItemRowHolder extends RecyclerView.ViewHolder {
  
      protected TextView tvTitle;
  
      protected ImageView itemImage;
  
  
      public SingleItemRowHolder(View view) {
          super(view);
  
          this.tvTitle = (TextView) view.findViewById(R.id.tvTitle1);
          this.itemImage = (ImageView) view.findViewById(R.id.itemImage);
  
  
          view.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
  
  
                  Intent intent = new Intent(v.getContext(), BooksDescription.class);
                  mContext.startActivity(intent);
  
              }
          });
  
  
      `}
  
  }}`
  </code></pre>