Answers for "recyclerview with radio button android"

0

recyclerview with radio button android

public class ViewHolder extends RecyclerView.ViewHolder {

     @Override
    public void onBindViewHolder(final ViewHolder holder, final int position) {
        boolean ischecked = position == checkedposition ? true : false;

        holder.tv.setText(productList.get(position));
        holder.tv.setChecked(lastSelectedPosition == position);
 		selectionState.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    lastSelectedPosition = getAdapterPosition();
                    notifyDataSetChanged();

                    Toast.makeText(OffersRecyclerViewAdapter.this.context,
                            "selected offer is " + offerName.getText(),
                                        Toast.LENGTH_LONG).show();
                }
            });
    }
Posted by: Guest on September-28-2020

Code answers related to "recyclerview with radio button android"

Browse Popular Code Answers by Language