0

In my application i want show some lists and for this i should use RecyclerView.

I get this lists from server, you can see sample of my json in bottom :

{ result:[ list1:{ title:title1, data:[ { id:1, name:name1_list1 }, { id:2, name:name1_list2 }, { id:3, name:name1_list3 } ] }, list2:{ title:title2, data:[ { id:2-1, name:name2_list1 }, { id:2-2, name:name2_list2 } ] }, list3:{ title:title3, data:[ { id:3-1, name:name3_list1 }, { id:3-2, name:name3_list2 }, { id:3-3, name:name3_list3 }, { id:3-4, name:name3_list4 } ] } ]} 

I want show data of title into recyclerView of title, and show data of data:[] in recyclerView.

How can i it? Thanks guys <3

Please help me

7
  • 2
    What you tried so far ?? Commented Jul 3, 2017 at 7:27
  • @IntelliJAmiya, can you help me? Commented Jul 3, 2017 at 7:29
  • Have you written any adapter class or made any layout? Commented Jul 3, 2017 at 7:41
  • @AyushKhare, i can write layout codes. but i don't know how can i get data from deference if lists and set into recyclerView Commented Jul 3, 2017 at 7:55
  • How are you trying to read this server response? Commented Jul 3, 2017 at 8:14

1 Answer 1

1

You are going to have to look into RecyclerView adapters.

https://developer.android.com/reference/android/support/v7/widget/RecyclerView.Adapter.html

These are then pushed into the layout (which you create) think of the layout as a placeholder for the data, but you need to program the new data that comes into into the adapter.
A good tutorial to learn this is have a read on Binpress Guide to (link below)

https://www.binpress.com/tutorial/android-l-recyclerview-and-cardview-tutorial/156

I have recently just learned how to tie adapters to views, and put in views and this tutorial helped out a lot.

P.S word of advice you need to place code examples or direct questions on what you are trying to do, or show an attempt of trying it.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.