I have a fragment that is inflating a recycler view, so far so good. The problem is that this fragment needs to inflate in two different navigation drawer, and at the time of casting, I can only cast one.
Is there any way to cast it, to identify which class is calling the fragment, and cast that particular class?
Below is the code that is giving error.
comunicadosList = ((NvdResp) getActivity()).getSetComunicadosList(3);
ComunicadosAdapter adapter = new ComunicadosAdapter(getActivity(), comunicadosList);
recyclerView.setAdapter(adapter);
In addition to the class NvdResp (which where I cast to fetch my list items to be inflated) I also have the class NvdAluno. Could I create a generic class or something like this?