posted 9 years ago
What needs to change is that the getItem and getCount need to return data based on whatever the server data indicate. getCount is called too often to obtain the number of pages from the server dynamically, so I suggest to run periodic background calls to the server (maybe once a minute via an AsyncTask) that inquire whether anything has changed, and adjust the local data based on what that call returns.
(I've removed the code of the fragment classes, since they don't matter for the purposes of this question.)