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

recyclerview item load recyclerview nested json

you have options here:

  1. 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(); } 
  1. 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

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -