In my application I am getting data from server and showing it using a table layout some times I am getting a data of atleast 20 to 30 rows but I want to show 4 rows at a time and then I want to show another 4 etc.
For this I want to know how can we use paging (Previous/Next) in Android if it’s not possible with tablelayout can any one suggest which field can give that facility I aleady tried with GridView also but no luck
You can try this way …
Store parsed data in List(or whatever) and create a method say createRows() which takes list as its argument and using list create rows.
So from your main list (parsed data list) create a sublist of size 4 and pass it to method. So initially it will create table with 4 row (as your requirement).
And on your next button first remove table’s current rows using removeAllViews() method and then extract another sublist containing next 4 data to be shown & again pass it to createRows() method.So now it will create table with new data.
Same thing can be applied to previous button.