title: show progress icon while loading page in ViewPager
body: <p>I am using AsyncTask in my application to load data from Internet. Here is onPostExecute method of my class that extends Async class.</p>
  
  <pre><code>protected void onPostExecute(Article result) {
      super.onPostExecute(result);
  
      TextView txtTitle= (TextView) view.findViewById(R.id.title);
      txtTitle.setText(result.getTitle());
  
      TextView txtMain= (TextView) view.findViewById(R.id.main);
      txtMain.setText(result.getContent());
  }
  </code></pre>
  
  <p>This is the overridden method from PageAdapter that instantiate pages. customlayout is the layout that shows article. </p>
  
  <pre><code>public Object instantiateItem(View container, int position) {
      LayoutInflater inflater = (LayoutInflater) container.getContext()
              .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
      View page= inflater.inflate(R.layout.customlayout , null);
  
      Worker aw = new Worker(page, container.getContext());
      aw.execute(links.get(position));
  
      ((ViewPager) container).addView(page,0);
      return page;
  }
  </code></pre>
  
  <p>Here is layout of a page that is inflated in each page.
      </p>
  
  <pre><code>&lt;TextView
      android:id="@+id/title"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
       /&gt;
  
  &lt;TextView
      android:id="@+id/main"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:textSize="20sp" /&gt;
  </code></pre>
  
  <p></p>
  
  <p>What I am trying to achieve is show a progress information until data loads. I should be able to swipe through page even while loading.
  I would be grateful if anyone would help.</p>
  
  <p>Also how can I control number of pages that are being loaded in background?</p>