When in a room, after pressing the Home key to return to the desktop, clicking the application icon to return to the application, why didn't it return to the room?
2021-09-09
Products / Plugins:Roomkit
Platform / Framework:Android
This problem is because after pressing the Home key to return to the desktop, the room interface will be minimized. When returning to the application, the displayRoomView interface of RoomKit SDK is not called to display the room interface, so the user cannot see the room interface.
To solve this problem, you need to add the following code in the onResume of the Activity that calls to join the room to display the room interface when returning to the application.
override fun onResume() {
super.onResume()
val inRoomService = ZegoRoomKit.getInRoomService()
if (inRoomService.currentRoomInfo != null && !inRoomService.isMinimized) {
// When returning from the desktop by clicking the icon, the following processing is required to ensure that the View in the room is displayed
// Here DemoMainActivity needs to be changed to the actual customer's Activity name
ZegoRoomKit.getInRoomService().displayRoomView(this@DemoMainActivity)
}
}
