Answer the question
In order to leave comments, you need to log in
How to open fragment from RecyclerView adapter?
I have an adapter that populates a RecyclerView. After reading the forums, I realized that the click handler must also be done in the adapter. How to open fragment on click on RecyclerView item?
FragmentTransaction fragmentTransaction = getFragmentManager().beginTransaction();
Answer the question
In order to leave comments, you need to log in
The adapter is responsible for populating the recyclerview. Need to create an interface
interface ItemClickListener{
void onItemClick(ItemType item);
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question