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
You just need an activity context passed in your constructor. Be sure to call new Adapter(this,...)
from activities and new Adapter(getActivity(),...)
from fragments.
private Context context;
@Override
public void onClick(View v) {
FragmentManager manager = ((AppCompatActivity)context).getSupportFragmentManager();
}