aboutsummaryrefslogtreecommitdiff
path: root/connectivity/bluetooth/BluetoothChat/Application/src/main/java/com/example/android/bluetoothchat/BluetoothChatService.java
diff options
context:
space:
mode:
Diffstat (limited to 'connectivity/bluetooth/BluetoothChat/Application/src/main/java/com/example/android/bluetoothchat/BluetoothChatService.java')
-rw-r--r--connectivity/bluetooth/BluetoothChat/Application/src/main/java/com/example/android/bluetoothchat/BluetoothChatService.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/connectivity/bluetooth/BluetoothChat/Application/src/main/java/com/example/android/bluetoothchat/BluetoothChatService.java b/connectivity/bluetooth/BluetoothChat/Application/src/main/java/com/example/android/bluetoothchat/BluetoothChatService.java
index b88b160d..a1e7cc01 100644
--- a/connectivity/bluetooth/BluetoothChat/Application/src/main/java/com/example/android/bluetoothchat/BluetoothChatService.java
+++ b/connectivity/bluetooth/BluetoothChat/Application/src/main/java/com/example/android/bluetoothchat/BluetoothChatService.java
@@ -473,7 +473,7 @@ public class BluetoothChatService {
int bytes;
// Keep listening to the InputStream while connected
- while (true) {
+ while (mState == STATE_CONNECTED) {
try {
// Read from the InputStream
bytes = mmInStream.read(buffer);