Skip to content

Commit 72a7948

Browse files
committed
修改读取报错时,直接停止服务
1 parent 9814d09 commit 72a7948

File tree

4 files changed

+4
-1
lines changed

4 files changed

+4
-1
lines changed

apk/app-debug-unaligned.apk

181 Bytes
Binary file not shown.

apk/app-debug.apk

181 Bytes
Binary file not shown.

app/libs/RXTXcomm.jar

-58.1 KB
Binary file not shown.

app/src/main/java/com/example/administrator/modbustcp/fragment/ReadWriteFragment.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,10 @@ public void onToast(String string) {
262262
msg.what = TOAST;
263263
msg.obj = string;
264264
handler.sendMessage(msg);
265-
265+
if (flag == 1){
266+
flag = 0;
267+
getActivity().unbindService(readConnection);
268+
}
266269
}
267270

268271
@Override

0 commit comments

Comments
 (0)