계속 질문해서 죄송합니다 ㅜㅜ
글에 첨부했던 코드 바로 위 코드 인데
void connectSelectedDevice(String selectedDeviceName) {
for(BluetoothDevice tempDevice : mPairedDevices) {
if (selectedDeviceName.equals(tempDevice.getName())) {
mBluetoothDevice = tempDevice;
break;
}
}
try {
mBluetoothSocket = mBluetoothDevice.createRfcommSocketToServiceRecord(BT_UUID);
mBluetoothSocket.connect();
mThreadConnectedBluetooth = new ConnectedBluetoothThread(mBluetoothSocket);
mThreadConnectedBluetooth.start();
mBluetoothHandler.obtainMessage(BT_CONNECTING_STATUS, 1, -1).sendToTarget();
} catch (IOException e) {
Toast.makeText(getApplicationContext(), "블루투스 연결 중 오류가 발생했습니다.", Toast.LENGTH_LONG).show();
}
mThreadConnectedBluetooth = new ConnectedBluetoothThread(mBluetoothSocket);
이렇게 썼는데 리스너 사용이 가능한가요?
프로젝트에서 작성해주신 코드로 썼더니 오류가 나네요 ㅠㅜ