Code example for FragmentActivity

Methods: findViewById

0
 
    /** 
     * Returns whether the checkbox with the given id is checked. 
     */ 
    private boolean isChecked(int id) {
      return ((CheckBox) findViewById(id)).isChecked();
    } 
 
    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 from the SupportMapFragment. 
            mMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map))
                    .getMap();
            // Check if we were successful in obtaining the map. 
            if (mMap != null) {
                setUpMap(); 
            } 
        } 
    }