0

I have a AsyncTask to get the web service data through JSON. I would like to have these items on pages with ViewPager and textsViews. My problem is how to do this without fragments, want it to be dynamic. I do not understand very well where I put the setViewAdapter would be in onPostExecute? To view the pager follow the following links:

View Pager Link 1

View Pager Link 2

I'm having trouble aligning these two things. Please help me!! Maybe my question was not clear. Thank you.

1 Answers1

0

What's problem while using fragments? They are just elements of ViewPager. So, create fragment which is consisted of textview(s).

To reload ViewPager use yourpager.setAdapter(adapter) inside onPostExecute() block.

That is , pipeline:

  1. initialize ViewPager

  2. Download data

  3. Reload ViewPager's elements.

Vyacheslav
  • 26,359
  • 19
  • 112
  • 194