title: getResources from FragmentStatePagerAdapter
body: <p>Inside an activity class, I have this class (from android samples):</p>
  
  <pre><code>    public static class DemoCollectionPagerAdapter extends FragmentStatePagerAdapter {
  
      public DemoCollectionPagerAdapter(FragmentManager fm) {
          super(fm);
      }
  
      @Override
      public Fragment getItem(int i) {
          Fragment fragment = new QuestionFragment();
          Bundle args = new Bundle();
          args.putInt(QuestionFragment.ARG_OBJECT, i ); 
          fragment.setArguments(args);
          return fragment;
      }
  
      @Override
      public int getCount() {
          return questionList.length;
      }
  
      @Override
      public CharSequence getPageTitle(int position) {
          return "Title n°" + (position + 1);
      }
  
  }
  </code></pre>
  
  <p>I would like to change this: <em>return "Title n°" + (position + 1);</em>
  to: <em>return getActivity().getResources().getString(R.string.questionTabTitle) + (position + 1);</em></p>
  
  <p>But the activity is undefined. How could I get the string resource that I need?</p>