title: Problems with FragmentPagerAdapter
body: <p>I'm trying to make a slidescreen with viewpager and fragments so that I can load different layouts per fragment and give each page different functionality.</p>
  
  <p>I followed a <a href="http://wptrafficanalyzer.in/blog/implementing-horizontal-view-swiping-using-viewpager-and-fragmentpageradapter-in-android/" rel="noreferrer">tutorial</a> to accomplish this.</p>
  
  <p>The error I'm getting when hovering over <code>public Fragment getItem(int arg0)</code>: The return type is incompatible with <code>FragmentPagerAdapter.getItem(int)</code> </p>
  
  <p>and error #2: The constructor <code>FragmentPagerAdapter(FragmentManager)</code> is undefined
  --> getting this one when hovering <code>super(fm);</code></p>
  
  <pre><code>package com.example.spui;
  
  import android.os.Bundle;
  import android.app.Fragment;
  import android.app.FragmentManager;
  import android.support.v4.app.FragmentPagerAdapter;
  
  public class MyFragmentPagerAdapter extends FragmentPagerAdapter{
  
      final int PAGE_COUNT = 5;
  
      /** Constructor of the class */
      public MyFragmentPagerAdapter(FragmentManager fm) {
          super(fm);
      }
  
      /** This method will be invoked when a page is requested to create */
      @Override
      public Fragment getItem(int arg0) {
  
          MyFragment myFragment = new MyFragment();
          Bundle data = new Bundle();
          data.putInt("current_page", arg0+1);
          myFragment.setArguments(data);
          return myFragment;
      }
  
      /** Returns the number of pages */
      @Override
      public int getCount() {
          return PAGE_COUNT;
      }
  }
  </code></pre>