diff --git a/library/src/main/java/app/akexorcist/bluetotohspp/library/BluetoothSPP.java b/library/src/main/java/app/akexorcist/bluetotohspp/library/BluetoothSPP.java index 869a98b..acf18aa 100644 --- a/library/src/main/java/app/akexorcist/bluetotohspp/library/BluetoothSPP.java +++ b/library/src/main/java/app/akexorcist/bluetotohspp/library/BluetoothSPP.java @@ -167,7 +167,7 @@ public void setDeviceTarget(boolean isAndroid) { } @SuppressLint("HandlerLeak") - private final Handler mHandler = new Handler() { + private final Handler mHandler = new Handler(Looper.getMainLooper()) { public void handleMessage(Message msg) { switch (msg.what) { case BluetoothState.MESSAGE_WRITE: