• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

need a page viewer with dynamic pages

 
Ranch Hand
Posts: 1325
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a pageviewer which contain 3 poages.its working fine.I need to improve it to dynamic pages.that mean number of pages depend on the server response.below is the current classes.

pageviewer class


 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.)
 
reply
    Bookmark Topic Watch Topic
  • New Topic