title: Implement intent into FragmentStatePagerAdapter
body: <p>Am trying to implement tab fragment. if i touch one tab in want to start new activity. in this case i used intent to start new activity but it not working. How can add intent here. </p>
  
  <pre><code>public class PagerAdapter extends FragmentStatePagerAdapter {
  int mNumOfTabs;
  
  public PagerAdapter(FragmentManager fm, int NumOfTabs) {
      super(fm);
      this.mNumOfTabs = NumOfTabs;
  }
  
  @Override
  public Fragment getItem(int position) {
  
      switch (position) {
  
          case 0:
              Intent intent = new Intent(new MainActivity(), Alarm.class);
              startActivity(intent);
  
          default:
              return null;
      }
  }
  
  @Override
  public int getCount() {
      return mNumOfTabs;
  }
  </code></pre>