I'm trying to do a Array
with different categories to show them in the same fragment
, the problem is that it only shows me a Array
and not both. I would like to know if it can be done like this or there is another way.
This is my code where I want to put the two Array
:
public class FragmentNovedades extends Fragment {
public RecyclerView recyclerView;
public LinearLayoutManager linearLayout;
public FragmentNovedades() { }
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_novedades, container, false);
recyclerView = (RecyclerView) view.findViewById(R.id.recycler_view);
recyclerView.setHasFixedSize(true);
linearLayout = new LinearLayoutManager(getActivity());
recyclerView = (RecyclerView) view.findViewById(R.id.recycler_view);
recyclerView.setLayoutManager(linearLayout);
ListaAdaptador adapter = new ListaAdaptador(getContext(),ListaObjetos.getCourses());
recyclerView.setAdapter(adapter);
//esta es la segunda lista que quiero meter pero solo me muestra la de
arriba
ListaAdaptadorVideo adaptervideo=new
ListaAdaptadorVideo(getContext(),ListaObjetosVideo.getVideos());
recyclerView.setAdapter(adaptervideo);
return view;
}
}
When I put the following two lines it does not show me both lists (only one), how can I do it to show the two ?:
ListaAdaptador adapter = new ListaAdaptador(getContext(),
ListaObjetos.getCourses());
ListaAdaptadorVideo adaptervideo=new ListaAdaptadorVideo(getContext(),
ListaObjetosVideo.getVideos());