嗨,我想让两个 Case语句仅运行一次。如何使conda env update -f=environment.yml
和PLAYER_GAMEPIECE_WRITE
Case语句像PLAYER_GAMEPIECE_READ
case一样只运行一次?他们似乎只是彼此循环。它不会继续进行下一种情况。
处理程序代码:
MESSAGE_DEVICE_NAME
BluetoothService代码:
private Handler mHandler = new Handler() {
@Override
public void handleMessage(final Message msg)
{
switch (msg.what)
{
// If the two devices are connected
case MESSAGE_DEVICE_NAME:
mConnectedDeviceName = msg.getData().getString(DEVICE_NAME);
Toast.makeText(TwoPlayerActivityBluetooth.this, "Connected to " + mConnectedDeviceName, Toast.LENGTH_SHORT).show();
case PLAYER_GAMEPIECE_WRITE:
//INSERT CODE HERE
break;
case PLAYER_GAMEPIECE_READ:
//INSERT CODE HERE
break;
case PLAYER_LOCATION_WRITE:
//INSERT CODE HERE
break;
case PLAYER_LOCATION_READ:
//INSERT CODE HERE
break;