I am converting ListView of my app to RecyclerView. On ListView, it was very easy to implement OnClickListener but in RecyclerView, we have to do it in adapter. I want to op
Make sure to pass context to the ArrayAdapter or RecyclerViewAdpater,So that we can get it inside Adapter Class.
If your mainActivity is extending Activity then use :
FragmentManager fragmentManager = ((Activity)context).getFragmentManager();
If your mainActivity is extending AppCompatActivity then use :
FragmentManager fragmentManager = ((AppCompatActivity)context).getSupportFragmentManager();