Code example for FragmentActivity

Methods: onResume

0
        setUpMapIfNeeded(); 
    } 
 
    @Override 
    protected void onResume() { 
        super.onResume(); 
        setUpMapIfNeeded(); 
    } 
 
    private void setUpMapIfNeeded() { 
        if (mMap == null) {
            mMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map)).getMap();
        } 
        if (mMap == null) {
            return; 
        } 
        // Initialize map options. For example: 
        // mMap.setMapType(GoogleMap.MAP_TYPE_HYBRID); 
    } 
}