diff --git a/app/src/main/java/com/casic/detector/common/view/MainActivity.kt b/app/src/main/java/com/casic/detector/common/view/MainActivity.kt index ae24b9e..3d7ff95 100644 --- a/app/src/main/java/com/casic/detector/common/view/MainActivity.kt +++ b/app/src/main/java/com/casic/detector/common/view/MainActivity.kt @@ -84,7 +84,6 @@ import com.pengxh.kt.lite.widget.dialog.BottomActionSheet import io.netty.buffer.Unpooled import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.delay import kotlinx.coroutines.launch import kotlinx.coroutines.withContext import java.io.File @@ -476,14 +475,7 @@ private val rtkConfigLauncher = registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { if (it.resultCode == Activity.RESULT_OK) { - lifecycleScope.launch(Dispatchers.IO) { - if (connectState == ConnectState.SUCCESS) { - socketClient.disconnect() - delay(3000) - } - - connectQianXunServer() - } + lifecycleScope.launch(Dispatchers.IO) { connectQianXunServer() } } } @@ -973,7 +965,7 @@ val byteBuf = Unpooled.wrappedBuffer(msg.toByteArray()) socketClient.sendData(byteBuf) - } else if (status == ConnectState.ERROR) { + } else { AlertControlDialog.Builder().setContext(context) .setTitle("温馨提示") .setMessage("千寻定位服务已断开,是否重连?")