title: Android ViewPager with dynamic content
body: <p>I need a little help to understand how can I change my current implementation of <code>ViewFlow</code> to android <code>v4.ViewPager</code>. Till now I was populating my views from <code>ArayLists&lt;?&gt;</code> with data. Now I need to use the same way I was doing it (if it's possible) and use ViewPager from Android SDK. Any suggestions would be great to understand how it's working, because the examples that I found over internet are using tabs and etc. but I don't need tabs.</p>
  
  <p>Here is how I was using my adapter before : </p>
  
  <pre><code>public class WebViewAdapter extends BaseAdapter  {
  
  private Activity activity;
  private ArrayList&lt;String&gt; name;
  private ArrayList&lt;String&gt; date;
  private ArrayList&lt;String&gt; bodies;
  private static LayoutInflater inflater = null;
  
  public WebViewAdapter(Activity a, ArrayList&lt;String&gt; names, ArrayList&lt;String&gt; dates, ArrayList&lt;String&gt; body) {
      this.activity = a;
      this.name = names;
      this.date = dates;
      this.bodies = body;
      inflater = (LayoutInflater) activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  }
  
  public int getCount() {
      return name.size();
  }
  
  public Object getItem(int position) {
      return position;
  }
  
  public long getItemId(int position) {
      return position;
  }
  
  public static class ViewHolder {
      public TextView title, date;
      public WebView body;
  }
  
  public View getView(int position, View convertView, ViewGroup parent) {
      View vi = convertView;
      ViewHolder holder;
      if (convertView == null) {
          vi = inflater.inflate(R.layout.article_layout, null);
          holder = new ViewHolder();
          holder.title = (TextView) vi.findViewById(R.id.article_title);
          holder.date = (TextView) vi.findViewById(R.id.date);
          holder.body = (WebView) vi.findViewById(R.id.body);
  
  
          vi.setTag(holder);
      } else
          holder = (ViewHolder) vi.getTag();
          holder.title.setText(name.get(position).toString());
          holder.date.setText(date.get(position).toString());
          holder.body.loadDataWithBaseURL(null, bodies.get(position).toString(), "text/html", "utf-8", null);
  
      return vi;
  }
  </code></pre>
  
  <p>}</p>
  
  <p>And I was using it like this : </p>
  
  <pre><code>WebViewAdapter adapter = new WebViewAdapter(this, titles, dates, bodies);
  viewFlow.setAdapter(adapter, pos);
  </code></pre>
  
  <p>Now I need the same result with the ViewPager implementation, because I am moving all my project to use Fragments and stuff from the new SDK API. </p>
  
  <p>Any advices / suggestions / help how can I achieve this?</p>