Buggy code:
public class BluetoothConnectedThread extends Thread { public static final int BUFFER_SIZE = 1024 * 1 ; private final BluetoothSocket bluetoothSocket ; private final InputStream inStream ; private final OutputStream outStream ; private Game game ; private VisitMultiplayerGame vmgClass ; private CreateMultiplayerGame cmgClass ; private BluetoothAdapter bluetoothAdapter ; private static BluetoothConnectedThread instance ; public static final String BLUETOOTH_HELLO = "_HELLO_" ; public static final String BLUETOOTH_ATTACK = "_ATTACK_" ; public static final String BLUETOOTH_RETURN = "_RETURN_" ; public static final String BLUETOOTH_ENEMY_FIELD = "_FIELD_" ; public static final String BLUETOOTH_ENEMY_FIELD_RETURN = "_FRETURN_" ; public static final String BLUETOOTH_ENEMY_SHIPS = "_SHIPS_" ; public static final String BLUETOOTH_NEWGAME = "_NEWGAME_" ; AndroidLauncher androidLauncher ; private int FieldMessageCounterToDoDelete ; public BluetoothConnectedThread ( BluetoothSocket socket , VisitMultiplayerGame vmgClass , CreateMultiplayerGame cmgClass , BluetoothAdapter bluetoothAdapter ) { } public static BluetoothConnectedThread getInstance ( ) { } public void setGame ( Game game ) { } public void run ( ) { byte [ ] buffer = new byte [ BluetoothConnectedThread . BUFFER_SIZE ] ; int bytes ; while ( true ) { try { if ( bluetoothSocket . isConnected ( ) ) { bytes = inStream . read ( buffer ) ; String readMsg = new String ( buffer , 0 , bytes ) ; if ( readMsg . startsWith ( BluetoothConnectedThread . BLUETOOTH_ATTACK ) ) { if ( game . getPrimaryBTGame ( ) ) { game . secondGamerAttack ( Integer . parseInt ( readMsg . substring ( ( ( readMsg . indexOf ( BluetoothConnectedThread . BLUETOOTH_ATTACK ) ) + ( BluetoothConnectedThread . BLUETOOTH_ATTACK . length ( ) ) ) ) ) ) ; } else if ( game . getSecondaryBTGame ( ) ) { game . firstGamerAttack ( Integer . parseInt ( readMsg . substring ( ( ( readMsg . indexOf ( BluetoothConnectedThread . BLUETOOTH_ATTACK ) ) + ( BluetoothConnectedThread . BLUETOOTH_ATTACK . length ( ) ) ) ) ) ) ; } } else if ( readMsg . startsWith ( BluetoothConnectedThread . BLUETOOTH_HELLO ) ) { String helloString ; if ( ( vmgClass ) != null ) { helloString = ( vmgClass . getString ( successfully_connected_with ) ) + ( readMsg . substring ( BluetoothConnectedThread . BLUETOOTH_HELLO . length ( ) ) ) ; this . vmgClass . showToast ( helloString ) ; } else { helloString = ( cmgClass . getString ( successfully_connected_with ) ) + ( readMsg . substring ( BluetoothConnectedThread . BLUETOOTH_HELLO . length ( ) ) ) ; this . cmgClass . showToast ( helloString ) ; } } else if ( readMsg . startsWith ( BluetoothConnectedThread . BLUETOOTH_RETURN ) ) { String returnAttackHitString = readMsg . substring ( ( ( readMsg . indexOf ( BluetoothConnectedThread . BLUETOOTH_RETURN ) ) + ( BluetoothConnectedThread . BLUETOOTH_RETURN . length ( ) ) ) , readMsg . indexOf ( "_" , ( ( readMsg . indexOf ( BluetoothConnectedThread . BLUETOOTH_RETURN ) ) + ( BluetoothConnectedThread . BLUETOOTH_RETURN . length ( ) ) ) ) ) ; boolean returnAttackHit = Boolean . parseBoolean ( returnAttackHitString ) ; String returnShipDestroyedString = readMsg . substring ( ( ( ( readMsg . indexOf ( returnAttackHitString ) ) + ( returnAttackHitString . length ( ) ) ) + 1 ) , readMsg . indexOf ( "_" , ( ( ( readMsg . indexOf ( returnAttackHitString ) ) + ( returnAttackHitString . length ( ) ) ) + 1 ) ) ) ; boolean returnShipDestroyed = Boolean . parseBoolean ( returnShipDestroyedString ) ; int ind = ( ( ( ( readMsg . indexOf ( returnAttackHitString ) ) + ( returnAttackHitString . length ( ) ) ) + 1 ) + ( returnShipDestroyedString . length ( ) ) ) + 1 ; String returnShipDestroyedIDs = readMsg . substring ( ind ) ; game . setReturnValues ( returnAttackHit , returnShipDestroyed , returnShipDestroyedIDs ) ; } else if ( readMsg . startsWith ( BluetoothConnectedThread . BLUETOOTH_NEWGAME ) ) { <START_BUG> CameraController . changeStateTo ( 8 , false ) ; <END_BUG> } else if ( readMsg . startsWith ( BluetoothConnectedThread . BLUETOOTH_ENEMY_FIELD_RETURN ) ) { game . getFirstFieldPlayer ( ) . setFeldUebertragenAntwort ( true ) ; } else if ( readMsg . startsWith ( BluetoothConnectedThread . BLUETOOTH_ENEMY_FIELD ) ) { String jsonPlacedShips = readMsg . substring ( BluetoothConnectedThread . BLUETOOTH_ENEMY_FIELD . length ( ) ) ; Json json = new Json ( ) ; ShipsDescriptor desc = json . fromJson ( ShipsDescriptor . class , jsonPlacedShips ) ; desc . replaceOldFieldPlacedShips ( game . getSecondFieldEnemy ( ) ) ; byte [ ] fieldBytes = BluetoothConnectedThread . BLUETOOTH_ENEMY_FIELD_RETURN . getBytes ( ) ; write ( fieldBytes ) ; } } } catch ( Exception e ) { break ; } } } public void reconnect ( ) { } private void sendHello ( ) { } public void write ( byte [ ] bytes ) { } public void setAndroidLauncher ( AndroidLauncher a ) { } }

Fix:
CameraController . changeStateTo ( 8 , false , true ) ;