title: The method getFragmentManager() is undefined for the type MainActivity
body: <p>I am trying to implement Google Map in android  using Google API, but I am getting the error</p>
  
  <blockquote>
    <p>The method getFragmentManager() is undefined for the type MainActivity</p>
  </blockquote>
  
  <p>the whole <code>MainActivity</code> code is as follows:</p>
  
  <pre><code>public class MainActivity extends Activity {
  
  private GoogleMap map;
  
    @Override
    protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      map = ((MapFragment) getFragmentManager().findFragmentById(R.id.map)).getMap();
  
    }
  }
  </code></pre>