java - How to send data From One RecyclerView Item to load another RecyclerView using Nested JSON -
i developing cinema app, want use 2 recyclerviews, 1 has loaded, contains list of cinemas, want when taps on of cinemas loads list of recyclerview containing movies.
how can deal 2 recyclerviews?
am new in android. below link sample of codes:
this link of sample codes
you have options here:
- the 2 recycler views displayed on screen @ same time.
this imply data in 2nd recylcler view need ability change multiple times.
add code in onitemselectlistener cinemarecyclerview
cinema selectedcinema = cinemas.get(selectedposition); // selected cinema cinemarecyclerview; moviesadapter.updatemovies(selectedcinema.getmovies);
in movieadapter class add following method.
public void updatemovies(list<movie> movies){ this.movies.clear(); this.movies.addall(movies); notifydatasetchanged(); }
- the cinema recycler view on 1 screen , movies list on next screen.
here need pass selected cinema object next activity/fragment. based on selection can directly instantiate moviesadapter correct movies list.
Comments
Post a Comment