Code example for FragmentActivity

Methods: onResume

0
        setUpMapIfNeeded(); 
    } 
 
    @Override 
    protected void onResume() { 
        super.onResume(); 
        setUpMapIfNeeded(); 
    } 
 
    private void setUpMapIfNeeded() { 
        // Do a null check to confirm that we have not already instantiated the map. 
        if (mMap == null) { 
            // Try to obtain the map wrap the SupportMapFragment. 
            mMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map)) 
                    .getPolarisMap(); 
            // Check if we were successful in obtaining the map. 
            if (mMap != null) { 
                setUpMap(); 
            } 
        } 
    }