0

This is my application require :
- Get data from a server (JSON)
- Show all data report like image above. Data will display as multi page ( do not scroll), use next and previous button to switch

See how I want: enter image description here

I can get data from server and show data as listview. But I have some problem and need help.

1. How to display data like image I attached. I found some way but seem it is not good
2. How to display data as multi page. I do not know exactly how much data because it depend data on Server, i have to show all data on server. Pages should auto generate depend on data.

Thanks you.

SweetWisher ツ
  • 7,296
  • 2
  • 30
  • 74
CauCuKien
  • 351
  • 1
  • 2
  • 12
  • use `TableView` to meet your requirement – Zubair Ahmed Oct 16 '14 at 11:01
  • [Possible duplicate](http://stackoverflow.com/questions/10553437/how-can-i-implement-paging-in-listview-in-android). And one more thing, **this is not an *default Android Behavior*, So Please do not follow this design.** Better to use *Load More* Functionality :) – SweetWisher ツ Oct 16 '14 at 11:06
  • @SweetWisherツ Can you suggest me another design to show the report ? Thanks – CauCuKien Oct 16 '14 at 11:31
  • [Load more list view](http://stackoverflow.com/questions/20458475/android-listview-to-load-more-items-when-reached-end) – SweetWisher ツ Oct 16 '14 at 11:38

2 Answers2

0

Simplest way to do it would be to create three datasets (let's say arraylists) and keep previous page data in one and current and future in the next one. Then put an onClickListener that changes the data in listviews and then notify adapter using .notifyDatasetChanged().

Ian
  • 2,024
  • 2
  • 12
  • 12
0

This is not an default Android Behavior, So Please do not follow this design. Better to use Load More Functionality :)

enter image description here
You can refer links for that.

Community
  • 1
  • 1
SweetWisher ツ
  • 7,296
  • 2
  • 30
  • 74