Buggy code:
public class NewTripFragment extends Fragment { public static final String TAG = "NEW_TRIPS_FRAGMENT_TAG" ; private final String PORTUGAL_CURRENCY = "€" ; private final String MINUTES = "min" ; private double tripTolerance = 15 ; private double tripPrice = 15 ; private TextView new_trip_fragment_origin_city_tv ; private TextView new_trip_fragment_destiny_city_tv ; private DatePicker new_trip_fragment_date_dp ; private TimePicker new_trip_fragment_time_tp ; private FloatingActionButton new_trip_fragment_price_fb_less ; private TextView new_trip_fragment_price_tv_value ; private FloatingActionButton new_trip_fragment_price_fb_more ; private Spinner new_trip_fragment_car_spinner_value ; private ImageView new_trip_fragment_bagage_icon ; private Spinner new_trip_fragment_bagage_spinner_value ; private FloatingActionButton new_trip_fragment_tolerance_fb_less ; private TextView new_trip_fragment_tolerance_tv_value ; private FloatingActionButton new_trip_fragment_tolerance_fb_more ; private EditText new_trip_fragment_observation_et_value ; private CheckBox new_trip_fragment_rules_cb_value ; private TextView registerTripTextView ; public NewTripFragment ( ) { } @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { } private void registerTrip ( View view ) { final Trip trip = new Trip ( ) ; trip . setDriverId ( Integer . valueOf ( UserAccountManager . getCurrentUserId ( getActivity ( ) . getApplicationContext ( ) ) ) ) ; trip . setVehicleId ( 1 ) ; trip . setStartCity ( new_trip_fragment_origin_city_tv . getText ( ) . toString ( ) ) ; trip . setEndCity ( new_trip_fragment_destiny_city_tv . getText ( ) . toString ( ) ) ; String startPoint = null ; String endPoint = null ; { Double originLatitude = getArguments ( ) . getDouble ( "originLatitude" ) ; Double originLongitude = getArguments ( ) . getDouble ( "originLongitude" ) ; if ( ( originLatitude != null ) && ( originLongitude != null ) ) { startPoint = ( ( String . valueOf ( originLatitude ) ) + ":" ) + ( String . valueOf ( originLongitude ) ) ; } Double destinyLatitude = getArguments ( ) . getDouble ( "destinyLatitude" ) ; Double destinyLongitude = getArguments ( ) . getDouble ( "destinyLongitude" ) ; if ( ( destinyLatitude != null ) && ( destinyLongitude != null ) ) { endPoint = ( ( String . valueOf ( destinyLatitude ) ) + ":" ) + ( String . valueOf ( destinyLongitude ) ) ; } } trip . setStartPoint ( startPoint ) ; trip . setEndPoint ( endPoint ) ; Calendar calendar ; { int day = new_trip_fragment_date_dp . getDayOfMonth ( ) ; int month = new_trip_fragment_date_dp . getMonth ( ) ; int year = new_trip_fragment_date_dp . getYear ( ) ; int hour = new_trip_fragment_time_tp . getCurrentHour ( ) ; int minute = new_trip_fragment_time_tp . getCurrentMinute ( ) ; calendar = Calendar . getInstance ( ) ; calendar . set ( year , month , day , hour , minute ) ; } trip . setTripDate ( calendar . getTime ( ) ) ; trip . setPrice ( tripPrice ) ; trip . setObservations ( new_trip_fragment_observation_et_value . getText ( ) . toString ( ) ) ; trip . setBaggageSize ( ( ( com . fmt . cheaptrip . entities . Baggage ) ( new_trip_fragment_bagage_spinner_value . getSelectedItem ( ) ) ) . getKey ( ) ) ; trip . setDelayTolerance ( 15 ) ; if ( ( ( ( ( ( ( ( ( ( ( trip . getDriverId ( ) ) == null ) || ( ( trip . getVehicleId ( ) ) == null ) ) || ( ( ( trip . getStartCity ( ) ) == null ) || ( trip . getStartCity ( ) . isEmpty ( ) ) ) ) || ( ( ( trip . getEndCity ( ) ) == null ) || ( trip . getEndCity ( ) . isEmpty ( ) ) ) ) || ( ( ( trip . getStartPoint ( ) ) == null ) || ( trip . getStartPoint ( ) . isEmpty ( ) ) ) ) || ( ( ( trip . getEndPoint ( ) ) == null ) || ( trip . getEndPoint ( ) . isEmpty ( ) ) ) ) || ( ( trip . getTripDate ( ) ) == null ) ) || ( ( trip . getPrice ( ) ) == null ) ) || ( ( trip . getBaggageSize ( ) ) == null ) ) || ( ( trip . getDelayTolerance ( ) ) == null ) ) { Toast . makeText ( getActivity ( ) , empty_fields_msg , LENGTH_LONG ) ; } else { if ( new_trip_fragment_rules_cb_value . isChecked ( ) ) { TripWSInvoker . registerTrip ( getActivity ( ) . getApplicationContext ( ) , trip , new WSResponseListener ( ) { @ Override public void onResponse ( WSResponseObject response ) { if ( response . getSuccess ( ) . equalsIgnoreCase ( "true" ) ) { Toast . makeText ( getActivity ( ) . getApplicationContext ( ) , trip_registered_msg , LENGTH_SHORT ) . show ( ) ; } } @ Override public void onError ( VolleyError error ) { } } ) ; } else { <START_BUG> Toast . makeText ( getActivity ( ) , accept_rules_msg , LENGTH_LONG ) ; <END_BUG> } } } private void fillUserVehiclesSpinner ( ) { } }

Fix:
Toast . makeText ( getActivity ( ) , accept_rules_msg , LENGTH_LONG ) . show ( ) ;