title: multiple instances of one fragment class
body: <p>I'm trying to create a viewpager that will contain a couple of pages, the thing is that all of the pages will look the same (just different data) so i've created a fragment class, and i'm trying to add to the viewpager adapter instances of that same class... but I can't..</p>
  
  <p><strong>How can I make a viewpager that every page is an instance of the same fragment class?
  meaning: same design - different data</strong></p>
  
  <p><strong>Edit...</strong>
  I took the general code from here...
  <a href="http://tamsler.blogspot.co.il/2011/10/android-viewpager-and-fragments.html" rel="nofollow">http://tamsler.blogspot.co.il/2011/10/android-viewpager-and-fragments.html</a></p>
  
  <p>and twicked it a-little bit</p>
  
  <pre><code>public class MainActivity extends FragmentActivity {
  
  private com.example.trying1.PagerAdapter mAdapter;
  
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      initPaging();
  }
  
  private void initPaging() {
      List&lt;Fragment&gt; fragments = new ArrayList&lt;Fragment&gt;();
      NoteFragment nf = new NoteFragment();
      Bundle bundle = new Bundle();
      bundle.putString("noteTitle", "A");
      nf.setArguments(bundle);
  
      NoteFragment nf1 = new NoteFragment();
      Bundle bundle1 = new Bundle();
      bundle1.putString("noteTitle", "B");
      nf1.setArguments(bundle1);
  
      fragments.add(nf);
      fragments.add(nf1);
      this.mAdapter = new com.example.trying1.PagerAdapter(
              getSupportFragmentManager(), fragments);
  
      ViewPager vPager = (ViewPager) findViewById(R.id.pager);
      vPager.setAdapter(this.mAdapter);
  }
  </code></pre>
  
  <p>}</p>