Code example for FragmentActivity

Methods: onResume

0
        setUpMapIfNeeded(); 
    } 
 
    @Override 
    protected void onResume() { 
        super.onResume(); 
        setUpMapIfNeeded(); 
    } 
 
    private void setUpMapIfNeeded() { 
        if (mMap != null) {
            return; 
        } 
        mMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map)).getMap();
        if (mMap != null) {
            startDemo(); 
        } 
    } 
 
    /** 
     * Run the demo-specific code.