title: Google maps can not resolve method getMap()
body: <p>I am using google map in my project. it was working but i did something( dont know what)now getMap() gives error. i think i update something. how can i fix it?</p>
  
  <p>my code is like that;</p>
  
  <pre><code>GoogleMap googleMap;
  ..
   if (locationManagerCheck.isLocationServiceAvailable()) {
          if (googleMap == null) {
              try {
                  googleMap = ((MapFragment) getFragmentManager().findFragmentById(R.id.map)).getMap();//ERROR
              } catch (Exception e) {
                  Toast.makeText(getApplicationContext(),
                          e.getMessage(), Toast.LENGTH_SHORT)
                          .show();
              }...
  </code></pre>
  
  <p>i tried make it:</p>
  
  <pre><code>  googleMap = ((MapFragment) getFragmentManager().findFragmentById(R.id.map)).getMapAsync(this);
  </code></pre>
  
  <p>but 'this' gives another error
  can you help me?</p>
  
  <p>edit:</p>
  
  <pre><code>    public class MainActivity extends FragmentActivity implements OnMapReadyCallback {
  
   @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
  
   LocationManager_check locationManagerCheck = new LocationManager_check(
                  this);
  
  
          if (locationManagerCheck.isLocationServiceAvailable()) {
              if (googleMap == null) {
                  try {
                      MapFragment mapFragment = (MapFragment) getFragmentManager().findFragmentById(R.id.map);
                      mapFragment.getMapAsync(this);
  
                  } catch (Exception e) {
                      Toast.makeText(getApplicationContext(),
                              e.getMessage(), Toast.LENGTH_SHORT)
                              .show();
                  }
                 {
                      if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED &amp;&amp; ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
                          // TODO: Consider calling
                          //    ActivityCompat#requestPermissions
                          // here to request the missing permissions, and then overriding
                          //   public void onRequestPermissionsResult(int requestCode, String[] permissions,
                          //                                          int[] grantResults)
                          // to handle the case where the user grants the permission. See the documentation
                          // for ActivityCompat#requestPermissions for more details.
                          return;
                      }
                      googleMap.setMyLocationEnabled(true);
  
                      googleMap.setOnInfoWindowClickListener(new GoogleMap.OnInfoWindowClickListener() {
                          @Override
                          public void onInfoWindowClick(final Marker marker) {....}
  
  
  
  }
  
   @Override
      public void onMapReady(GoogleMap Map) {
          googleMap=Map;
      }
  
  
  
  }
  </code></pre>