Buggy code:
public class MapFragment extends Fragment implements GpsEventListener , EditEventListener , MapViewEventListener { private static final int MIN_SATELLITES_IN_FIX = 3 ; protected static final int mMargins = 10 ; protected float mTolerancePX ; protected MapViewOverlays mMap ; protected ImageView mivZoomIn ; protected ImageView mivZoomOut ; protected TextView mStatusSource ; protected TextView mStatusAccuracy ; protected TextView mStatusSpeed ; protected TextView mStatusAltitude ; protected TextView mStatusLatitude ; protected TextView mStatusLongitude ; protected FrameLayout mStatusPanel ; protected RelativeLayout mMapRelativeLayout ; protected GpsEventSource mGpsEventSource ; protected View mMainButton ; protected int mMode ; protected CurrentLocationOverlay mCurrentLocationOverlay ; protected CurrentTrackOverlay mCurrentTrackOverlay ; protected EditLayerOverlay mEditLayerOverlay ; protected int mCoordinatesFormat ; protected static final int MODE_NORMAL = 0 ; protected static final int MODE_SELECT_ACTION = 1 ; protected static final int MODE_EDIT = 2 ; protected static final int MODE_HIGHLIGHT = 3 ; protected static final String KEY_MODE = "mode" ; protected boolean mShowStatusPanel ; protected final int ADD_CURRENT_LOC = 1 ; protected final int ADD_NEW_GEOMETRY = 2 ; @ Override public void onCreate ( Bundle savedInstanceState ) { } protected void setMode ( int mode ) { MainActivity activity = ( ( MainActivity ) ( getActivity ( ) ) ) ; final BottomToolbar toolbar = activity . getBottomToolbar ( ) ; switch ( mode ) { case MapFragment . MODE_NORMAL : if ( null != toolbar ) { toolbar . setVisibility ( GONE ) ; } if ( null != ( mMainButton ) ) mMainButton . setVisibility ( VISIBLE ) ; if ( mShowStatusPanel ) mStatusPanel . setVisibility ( VISIBLE ) ; break ; case MapFragment . MODE_EDIT : if ( null != toolbar ) { if ( null != ( mMainButton ) ) mMainButton . setVisibility ( GONE ) ; mStatusPanel . setVisibility ( INVISIBLE ) ; toolbar . setVisibility ( VISIBLE ) ; toolbar . getBackground ( ) . setAlpha ( 128 ) ; Menu menu = toolbar . getMenu ( ) ; if ( null != menu ) menu . clear ( ) ; if ( null != ( mEditLayerOverlay ) ) { mEditLayerOverlay . setMode ( EditLayerOverlay . MODE_EDIT ) ; mEditLayerOverlay . setToolbar ( toolbar ) ; } } break ; case MapFragment . MODE_SELECT_ACTION : if ( null != toolbar ) { if ( null != ( mMainButton ) ) mMainButton . setVisibility ( GONE ) ; mStatusPanel . setVisibility ( INVISIBLE ) ; toolbar . setNavigationIcon ( ic_action_cancel ) ; toolbar . setNavigationOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View view ) { if ( null != ( mEditLayerOverlay ) ) { mEditLayerOverlay . setMode ( MODE_NONE ) ; } setMode ( MapFragment . MODE_NORMAL ) ; } } ) ; toolbar . setVisibility ( VISIBLE ) ; toolbar . getBackground ( ) . setAlpha ( 128 ) ; toolbar . setOnMenuItemClickListener ( new BottomToolbar . OnMenuItemClickListener ( ) { @ Override public boolean onMenuItemClick ( MenuItem item ) { switch ( item . getItemId ( ) ) { case id . menu_edit : setMode ( MapFragment . MODE_EDIT ) ; break ; case id . menu_delete : if ( null != ( mEditLayerOverlay ) ) { mEditLayerOverlay . deleteItem ( ) ; } setMode ( MapFragment . MODE_NORMAL ) ; break ; case id . menu_info : boolean tabletSize = getResources ( ) . getBoolean ( isTablet ) ; FragmentManager fragmentManager = getActivity ( ) . getSupportFragmentManager ( ) ; AttributesFragment attributesFragment = new AttributesFragment ( ) ; attributesFragment . setTablet ( tabletSize ) ; FragmentTransaction fragmentTransaction = fragmentManager . beginTransaction ( ) ; <START_BUG> int container = id . map ; <END_BUG> if ( ! ( attributesFragment . isTablet ( ) ) ) { Fragment hide = fragmentManager . findFragmentById ( map ) ; fragmentTransaction . hide ( hide ) ; } else container = id . fl_attributes ; fragmentTransaction . add ( container , attributesFragment , "ATTRIBUTES" ) . setTransition ( TRANSIT_FRAGMENT_OPEN ) . addToBackStack ( null ) . commit ( ) ; attributesFragment . setSelectedFeature ( mEditLayerOverlay . getSelectedLayer ( ) , mEditLayerOverlay . getSelectedItemId ( ) ) ; setMode ( MapFragment . MODE_HIGHLIGHT ) ; break ; } return true ; } } ) ; Menu menu = toolbar . getMenu ( ) ; if ( null != menu ) menu . clear ( ) ; toolbar . inflateMenu ( select_action ) ; } break ; case MapFragment . MODE_HIGHLIGHT : if ( null != toolbar ) { toolbar . setVisibility ( GONE ) ; if ( null != ( mMainButton ) ) mMainButton . setVisibility ( GONE ) ; mStatusPanel . setVisibility ( INVISIBLE ) ; } break ; } mMode = mode ; } protected void distributeToolbarItems ( Toolbar toolbar ) { } @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { } @ Override public void onDestroyView ( ) { } protected void removeMapButtons ( RelativeLayout rl ) { } protected void addMapButtons ( Context context , RelativeLayout rl ) { } @ Override public void onLayerAdded ( int id ) { } @ Override public void onLayerDeleted ( int id ) { } @ Override public void onLayerChanged ( int id ) { } @ Override public void onExtentChanged ( float zoom , GeoPoint center ) { } @ Override public void onLayersReordered ( ) { } @ Override public void onLayerDrawFinished ( int id , float percent ) { } protected void setZoomInEnabled ( boolean bEnabled ) { } protected void setZoomOutEnabled ( boolean bEnabled ) { } @ Override public void onSaveInstanceState ( Bundle outState ) { } @ Override public void onViewStateRestored ( @ Nullable Bundle savedInstanceState ) { } @ Override public void onPause ( ) { } @ Override public void onResume ( ) { } protected void addNewGeometry ( ) { } protected void addCurrentLocation ( ) { } protected void addGeometryByWalk ( ) { } public void onFinishChooseLayerDialog ( int code , ILayer layer ) { }

Fix:
int container = id . mainview ;