I have a recyclerview list that renders dish names from a SQLite database. For him, I created the RecyclerItemClickListener event handler, but for now he only displays toast. What to do, so that when you click on an item, the second activation opens with detailed information about the recipe (Ingredients, recipe).

1 answer 1

Write an ViewHolder'a method in the adapter for onClick and in it:

 Intent intent = new Intent (YourActivity.this, SecondActivity.class); intent.put("dishId", list.get(getAdapterPosition()).getId()); и т.д. startActivity(intent); 

In the second Activiti, locate your dish by Id. getIntent().getInt("dishId");

Naturally, everything must be done through the MVC pattern (read if you do not know).

Or you can do all the "handles", put ( put ) in the intent all the parameters one by one and also get them