- case MSG_INCOMING_TELEM:
- byte[] buf = (byte[]) msg.obj;
- // construct a string from the buffer
- String telem = new String(buf);
- ad.mSerialView.append(telem);
- break;
- case MSG_DEVNAME:
- // save the connected device's name
- ad.mConnectedDeviceName = msg.getData().getString(KEY_DEVNAME);
- Toast.makeText(ad.getApplicationContext(), "Connected to "
- + ad.mConnectedDeviceName, Toast.LENGTH_SHORT).show();
- break;
- case MSG_TOAST:
- Toast.makeText(
- ad.getApplicationContext(),
- msg.getData().getString(KEY_TOAST),
- Toast.LENGTH_SHORT).show();