Buggy code:
@ Override public void onAttach ( Activity activity ) { } @ Override public void onCreate ( @ Nullable Bundle savedInstanceState ) { } @ Override public void onSaveInstanceState ( Bundle outState ) { } @ Override public void onDestroyView ( ) { } @ Nullable @ Override public View onCreateView ( LayoutInflater inflater , @ Nullable final ViewGroup container , @ Nullable Bundle savedInstanceState ) { if ( ( connectStatus ) == ( ConnectionStatus . DISCONNECTED ) ) { View view = inflater . inflate ( new_connect , container , false ) ; final FloatingActionButton fab = ( ( FloatingActionButton ) ( view . findViewById ( verifyYesButton ) ) ) ; final FloatingActionButton disFab = ( ( FloatingActionButton ) ( view . findViewById ( disConnectBtn ) ) ) ; mServerId = ( ( EditText ) ( view . findViewById ( connect_server ) ) ) ; mPort = ( ( EditText ) ( view . findViewById ( connect_port ) ) ) ; mClientId = ( ( EditText ) ( view . findViewById ( clientId ) ) ) ; mConnStatus = ( ( TextView ) ( view . findViewById ( connect_status ) ) ) ; mIsRemember = ( ( CheckBox ) ( view . findViewById ( isRemember ) ) ) ; easyHistoryLab = EasyHistoryLab . getEasyHistoryLab ( getContext ( ) ) ; easyConnectFragment = EasyConnectFragment . newInstance ( ) ; mIsRemember . setOnCheckedChangeListener ( new CompoundButton . OnCheckedChangeListener ( ) { @ Override public void onCheckedChanged ( CompoundButton buttonView , boolean isChecked ) { if ( isChecked ) { connection . setRemember ( true ) ; } else { connection . setRemember ( false ) ; } } } ) ; if ( ( connection . getConnectionStatus ( ) ) == ( ConnectionStatus . CONNECTED ) ) { fab . hide ( ) ; disFab . show ( ) ; connection . setServerId ( mServerId . getText ( ) . toString ( ) ) ; connection . setPort ( mPort . getText ( ) . toString ( ) ) ; connection . setClientId ( mClientId . getText ( ) . toString ( ) ) ; mConnStatus . setBackgroundColor ( ContextCompat . getColor ( getContext ( ) , colorPrimaryDark ) ) ; mConnStatus . setText ( getString ( connect ) ) ; } if ( ( connection . getConnectionStatus ( ) ) == ( ConnectionStatus . DISCONNECTED ) ) { mConnStatus . setBackgroundColor ( ContextCompat . getColor ( getContext ( ) , colorAccent ) ) ; mConnStatus . setText ( getString ( disconnected ) ) ; } fab . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View view ) { try { brokerURL = ( ( "tcp:////" + ( mServerId . getText ( ) . toString ( ) ) ) + ":" ) + ( mPort . getText ( ) . toString ( ) ) ; connection . connectServer ( brokerURL , mClientId . getText ( ) . toString ( ) ) ; updateHistorydateAndUI ( getString ( new_connection ) , "<seq2seq4repair_space>" , NEWCONNECT , new EasyConnectHistory ( ) ) ; Snackbar . make ( view , ( ( ( ( getString ( con_success ) ) + ( mServerId . getText ( ) . toString ( ) ) ) + ( getString ( to_string ) ) ) + ( mClientId . getText ( ) . toString ( ) ) ) , LENGTH_SHORT ) . setAction ( "Action" , null ) . show ( ) ; connection . setConnectionStatus ( CONNECTED ) ; mConnStatus . setText ( getString ( connect ) ) ; mConnStatus . setBackgroundColor ( ContextCompat . getColor ( getContext ( ) , colorPrimaryDark ) ) ; fab . hide ( ) ; disFab . show ( ) ; <START_BUG> updateHistorydateAndUI ( ( ( ( ( getString ( con_success ) ) + ( mServerId . getText ( ) . toString ( ) ) ) + ":" ) + ( mPort . getText ( ) . toString ( ) ) ) , ( "Client<seq2seq4repair_space>ID<seq2seq4repair_space>is<seq2seq4repair_space>" + ( mClientId . getText ( ) . toString ( ) ) ) , CONNECTED , new EasyConnectHistory ( ) ) ; <END_BUG> } catch ( MqttException e ) { updateHistorydateAndUI ( getString ( failure_connect ) , e . toString ( ) , DISCONNECTED , new EasyConnectHistory ( ) ) ; connection . setConnectionStatus ( DISCONNECTED ) ; Snackbar . make ( view , ( ( getString ( conn_fail ) ) + ( e . toString ( ) ) ) , LENGTH_SHORT ) . setAction ( "Action" , null ) . show ( ) ; Log . i ( MQTTConnectFragment . TAG , e . toString ( ) ) ; connection . clear ( ) ; mConnStatus . setText ( getString ( Disconnect ) ) ; connection . setConnectionStatus ( DISCONNECTED ) ; mConnStatus . setBackgroundColor ( ContextCompat . getColor ( getContext ( ) , colorAccent ) ) ; } } } ) ; disFab . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View view ) { new android . support . v7 . app . AlertDialog . Builder ( getContext ( ) ) . setTitle ( getString ( disconnectClient ) ) . setMessage ( getString ( disconnectClient ) ) . setPositiveButton ( getString ( yes_btn ) , new DialogInterface . OnClickListener ( ) { @ Override public void onClick ( DialogInterface dialog , int which ) { try { connection . disConnectServer ( ) ; mConnStatus . setText ( getString ( disconnected ) ) ; mConnStatus . setBackgroundColor ( ContextCompat . getColor ( getContext ( ) , colorAccent ) ) ; updateHistorydateAndUI ( getString ( disconnected ) , "<seq2seq4repair_space>" , DISCONNECTED , new EasyConnectHistory ( ) ) ; connection . setConnectionStatus ( DISCONNECTED ) ; } catch ( MqttException e ) { String errorInfo = e . toString ( ) ; mConnStatus . setText ( ( ( getString ( failure_disconnect ) ) + errorInfo ) ) ;

Fix:
updateHistorydateAndUI ( ( ( ( ( getString ( con_success ) ) + ( mServerId . getText ( ) . toString ( ) ) ) + ":" ) + ( mPort . getText ( ) . toString ( ) ) ) , ( ( getString ( to_string ) ) + ( mClientId . getText ( ) . toString ( ) ) ) , CONNECTED , new EasyConnectHistory ( ) ) ;