title: Intent from Fragment to a MapsActivity from onCreateView
body: <p>this is my code of my third tab in which i have put a button to intent from this current fragment to my MapsActivity, but as soon as i click my button, the app stops running.</p>
  
  <p>This is my code:</p>
  
  <pre><code>public View onCreateView(LayoutInflater inflater, ViewGroup container,
                           Bundle savedInstanceState) {
      // Inflate the layout for this fragment
  
  
      View v= inflater.inflate(R.layout.fragment_tab3, container, false);
  
      mapbtn = (Button) v.findViewById(R.id.mapButton);
  
      mapbtn.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View view) {
  
              Intent intent = new Intent(getActivity(), MapsActivity.class);
              startActivity(intent);
          }
      });
  
      return v;
  
  }
  </code></pre>
  
  <p>Please someone help!!!</p>