title: Android GoogleMap: change getFragmentManager() to SupportMapFragment() - NullPointerException
body: <p>I want the application to run on the version of Android - 8</p>
  
  <p>I found some "answers", but still receives on a NullPointerException.</p>
  
  <pre><code>        try {   
              FragmentManager myFM = ActivityMapa.this.getSupportFragmentManager();
  
              final SupportMapFragment myMAPF = (SupportMapFragment) myFM.findFragmentById(R.id.mapa);
              map = myMAPF.getMap();
          } catch (Exception e) {
              Log.d("mapa", "FR error: " + e);
              map = ((MapFragment) getFragmentManager().findFragmentById(R.id.mapa)).getMap();
          }
  </code></pre>
  
  <p>second answer:</p>
  
  <pre><code>// in try()
  map = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.mapa)).getMap();
  </code></pre>
  
  <p>The code is in:</p>
  
  <pre><code>public class ActivityMap extends ActivityOptions {  // ActivityOptions extends FragmentActivity
  
      (...)
      protected void onCreate() {
  
          // try()
  
      }
  
  
  }
  </code></pre>
  
  <p>What to do to not get an exception?</p>