how to display listview in viewpager

373 viewslistview pagerview
0
X Fa | 12 xp

hi

the above image shows a simple view of my app

there is some mysql databases on the server like restaurant names, categories and foods

in the activity 1 , the app shows restaurant names in a listview, by selecting one of them, activity 2 start and display categories of that restaurant in a horizontal recyclerview and foods of each category in a listview in each page of one pagerview. I could do that until the recyclerview section, but I dont know how to show foods of each category in a listview in each page of viewpager!

these are my xml and code:

Activity 2 java:

fragment_main xml:

Activity 2 xml :

Attachments

data.jpg
0
Kanthikiran_Nalamati | 76 xp

if you know how to set the listview in the fragment or activity then it is like normal only..the only diff is you are adding the code in the view pager

https://stackoverflow.com/questions/33064199/fragment-transcation-to-viewpager-inside-listview-item-click-listener-in-android

0
Lakshmi Priya | 125 xp

you have to create one custom adapter with listview and set this adapter to view pager.

 

you may refer this page for reference :

http://android-er.blogspot.in/2014/04/example-of-viewpager-with-custom.html