Obtenir la liste des coché les cases de recyclerview android

J'ai renseigné les recyclerView avec l'image, le titre et la case à cocher.
J'ai deux problèmes.

  1. Comment faire de la case sélectionnée lors de l'imageview ou de l'ensemble du recycleur élément est cliqué.

  2. Je dois aller à la prochaine activité par l'obtention de tous les éléments cochés de la recyclerview.

Ma mise en page :

<RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="8dp">

        <ImageView
            android:id="@+id/image"
            android:layout_width="match_parent"
            android:layout_height="150dp"
            android:layout_gravity="center_horizontal"
            android:contentDescription="Interests"
            android:scaleType="centerCrop"
            android:src="@drawable/ic_yash_dp" />

        <TextView
            android:id="@+id/title"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            android:layout_alignParentLeft="true"
            android:layout_alignParentStart="true"
            android:layout_gravity="bottom"
            android:layout_margin="5dp"
            android:layout_marginTop="24dp"
            android:background="@drawable/rounded_corners"
            android:gravity="bottom"
            android:padding="5dp"
            android:text="GYM"
            android:textAlignment="center"
            android:textColor="@color/white" />

        <CheckBox
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/checkBox"
            android:layout_margin="2dp"
            android:layout_alignParentTop="true"
            android:layout_alignParentRight="true"
            android:layout_alignParentEnd="true" />

    </RelativeLayout>

Mon adaptateur:

@Override
public void onBindViewHolder(RecyclerViewHolder holder, int position) {
final InterestBean model = arrayList.get(position);
final int pos = position;

RecyclerViewHolder mainHolder = (RecyclerViewHolder) holder;//holder

Bitmap image = BitmapFactory.decodeResource(context.getResources(),
        model.getImage());//This will convert drawbale image into bitmap

//setting title
mainHolder.title.setText(model.getTitle());
mainHolder.imageview.setImageBitmap(image);
mainHolder.checkBox.setChecked(arrayList.get(position).isSelected());
mainHolder.checkBox.setTag(arrayList.get(position));


mainHolder.checkBox.setOnClickListener(new View.OnClickListener()     {
public void onClick(View v) {
CheckBox cb = (CheckBox) v;
InterestBean contact = (InterestBean) cb.getTag();

contact.setIsSelected(cb.isChecked());
arrayList.get(pos).setIsSelected(cb.isChecked());
selectedItems.add(pos);
Toast.makeText(
v.getContext(), pos + cb.isChecked(), Toast.LENGTH_LONG).show();
}
});}
InformationsquelleAutor Yashwanth | 2015-10-30