diff --git a/Android/APIExample/app/src/main/java/io/agora/api/example/examples/basic/JoinChannelAudio.java b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/basic/JoinChannelAudio.java index 24176c0d5..44a564abe 100755 --- a/Android/APIExample/app/src/main/java/io/agora/api/example/examples/basic/JoinChannelAudio.java +++ b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/basic/JoinChannelAudio.java @@ -616,7 +616,12 @@ public void onUserOffline(int uid, int reason) { Log.i(TAG, String.format(LABLE + " user %d offline! reason:%d", uid, reason)); runOnUIThread(() -> { audioSeatManager.downSeat(uid); - remoteUidList.remove(uid); + if (remoteUidList.contains(uid)) { + remoteUidList.remove((Integer) uid); + Log.d(TAG, "After removing UID, remoteUidList: " + remoteUidList); + } else { + Log.w(TAG, "UID not found in remoteUidList: " + uid); + } }); }