Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3ec28c8

Browse files
author
xianing
committed
fix clear remote view issue
1 parent 4f55af9 commit 3ec28c8

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ public void onClick(View v)
192192
* 2:If you call the leaveChannel method during CDN live streaming, the SDK
193193
* triggers the removeInjectStreamUrl method.*/
194194
engine.leaveChannel();
195+
clearRemoteViews();
195196
join.setText(getString(R.string.join));
196197
}
197198
}
@@ -513,6 +514,15 @@ public void onRtcStats(io.agora.rtc.IRtcEngineEventHandler.RtcStats rtcStats) {
513514
}
514515
};
515516

517+
private void clearRemoteViews() {
518+
remoteViews.clear();
519+
fl_remote.removeAllViews();
520+
fl_remote_2.removeAllViews();
521+
fl_remote_3.removeAllViews();
522+
fl_remote_4.removeAllViews();
523+
fl_remote_5.removeAllViews();
524+
}
525+
516526
private ViewGroup getAvailableView() {
517527
if(fl_remote.getChildCount() == 0){
518528
return fl_remote;

0 commit comments

Comments
 (0)