Skip to content

Commit 51099e4

Browse files
authored
Merge pull request #444 from AgoraIO/dev/zw/4.5.0_fixs
[Fix][Android] fixs IndexOutOfBoundsException
2 parents 854c5a0 + 3c45a97 commit 51099e4

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Android/APIExample/app/src/main/java/io/agora/api/example/examples/basic/JoinChannelAudio.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,12 @@ public void onUserOffline(int uid, int reason) {
616616
Log.i(TAG, String.format(LABLE + " user %d offline! reason:%d", uid, reason));
617617
runOnUIThread(() -> {
618618
audioSeatManager.downSeat(uid);
619-
remoteUidList.remove(uid);
619+
if (remoteUidList.contains(uid)) {
620+
remoteUidList.remove((Integer) uid);
621+
Log.d(TAG, "After removing UID, remoteUidList: " + remoteUidList);
622+
} else {
623+
Log.w(TAG, "UID not found in remoteUidList: " + uid);
624+
}
620625
});
621626
}
622627

0 commit comments

Comments
 (0)