There is a recyclerview, each element of which contains a pair of text fields and a button. With the help of the adapter this whole thing is filled:
public class RVAdapterStart extends RecyclerView.Adapter<RVAdapterStart.TaskViewHolder> { public static class TaskViewHolder extends RecyclerView.ViewHolder { RelativeLayout relativeLayout; private TextView title; private TextView status; private Button button; TaskViewHolder(View view) { super(view); relativeLayout = (RelativeLayout) view.findViewById(R.id.frameLayout); title = (TextView) view.findViewById(R.id.title); status = (TextView) view.findViewById(R.id.status); button = (Button) view.findViewById(R.id.tasks_finish); } } private List<Task> tasksStart; RVAdapterStart() { } @Override public void onAttachedToRecyclerView(RecyclerView recyclerView) { super.onAttachedToRecyclerView(recyclerView); } @Override public void onBindViewHolder(TaskViewHolder holder, final int position) { holder.title.setText(tasksStart.get(position).getTitle()); holder.status.setText(tasksStart.get(position).getStatus()); } @Override public int getItemCount() { return tasksStart.size(); } @Override public TaskViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) { View view = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.list_tasks_start, viewGroup, false); TaskViewHolder tvh = new TaskViewHolder(view); return tvh; } How to get access to these elements from the activation (you need to hang the listeners on the buttons)?
onCreateViewHoldermethod? - pavel