From fa3ac69752d63f17b1e086d066d625e57b43920d Mon Sep 17 00:00:00 2001 From: maxinyu Date: Mon, 25 May 2026 17:08:45 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=B3=E8=81=94=E7=94=A8=E6=88=B7=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../liveVideo/LinkedUserActivity.kt | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/com/example/defenseapplication/liveVideo/LinkedUserActivity.kt b/app/src/main/java/com/example/defenseapplication/liveVideo/LinkedUserActivity.kt index 465176a..4a3cea5 100644 --- a/app/src/main/java/com/example/defenseapplication/liveVideo/LinkedUserActivity.kt +++ b/app/src/main/java/com/example/defenseapplication/liveVideo/LinkedUserActivity.kt @@ -181,16 +181,19 @@ class LinkedUserActivity : AppCompatActivity() { binding.swipeRefresh.isRefreshing = true lifecycleScope.launch { try { - val deviceId = DeviceIdEvent.getDeviceId() - if (deviceId.isNullOrEmpty()) { - Toast.makeText(this@LinkedUserActivity, "设备 ID 为空", Toast.LENGTH_SHORT).show() - withContext(Dispatchers.Main) { - binding.swipeRefresh.isRefreshing = false + var deviceId: String? = null + if (mode == MODE_SETTINGS) { + deviceId = DeviceIdEvent.getDeviceId() + if (deviceId.isNullOrEmpty()) { + Toast.makeText(this@LinkedUserActivity, "设备 ID 为空", Toast.LENGTH_SHORT).show() + withContext(Dispatchers.Main) { + binding.swipeRefresh.isRefreshing = false + } + return@launch } - return@launch } val response = if (mode == MODE_SETTINGS) { - RetrofitNetwork.getNetworkService().getDeviceUserList(deviceId) + RetrofitNetwork.getNetworkService().getDeviceUserList(deviceId!!) } else { RetrofitNetwork.getNetworkService().getFamilyMembers() }