title: How to add a button to viewpager with setOnClickListener
body: <p>I have a layout with a buttons. I use FragmentActivity:</p>
  
  <pre><code>public class slidepage extends FragmentActivity {
  
  private static final int NUM_PAGES = 5;
  
  private ViewPager mPager;
  
  private PagerAdapter mPagerAdapter;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
  
      setContentView(R.layout.activity_screen_slide);
  
  
      mPager = (ViewPager) findViewById(R.id.pager);
      mPagerAdapter = new ScreenSlidePagerAdapter(getSupportFragmentManager());
      mPager.setAdapter(mPagerAdapter);
  
      Button Back = (Button) findViewById(R.id.back);
  
      Back.setOnClickListener(new View.OnClickListener() {
  
          @Override
          public void onClick(View v) {
  
              onBackPressed();
  
          }
      });
  
  }
  
  }
  </code></pre>
  
  <p>slide class:</p>
  
  <pre><code>public class slider extends Fragment {
  
  @Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
  
      ViewGroup view;
  
      if(GlobalConfig.tryb) {
          view = (ViewGroup) inflater.inflate(R.layout.n_podglad, container, false);
      } else {
          view = (ViewGroup) inflater.inflate(R.layout.d_podglad, container, false);
      }
  
      /* Powrót */
  
      Button Back = (Button) view.findViewById(R.id.back);
  
      Back.setOnClickListener(new View.OnClickListener() {
  
          @Override
          public void onClick(View v) {
  
              //onBackPressed();
  
          }
      });
  
      return view;
  }
  }
  </code></pre>
  
  <p>Unfortunately my button not works. I receive null reference in log. What is wrong? How can I set OnClickListener on my buttons in viewpager?</p>