# Zoom android sdk leaves meeting after host admit the user

**URL:** <https://devforum.zoom.us/t/zoom-android-sdk-leaves-meeting-after-host-admit-the-user/47244>\
**Category:** Android\
**Created:** [April 5, 2021, 9:24am UTC](https://devforum.zoom.us/t/zoom-android-sdk-leaves-meeting-after-host-admit-the-user/47244 "2021-04-05T09:24:02Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![hoang\_nguyen](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/hoang_nguyen/32/18526_2.png) [@hoang\_nguyen](https://devforum.zoom.us/u/hoang_nguyen)\
**Post date:** [April 5, 2021, 9:24am UTC](https://devforum.zoom.us/t/zoom-android-sdk-leaves-meeting-after-host-admit-the-user/47244/1 "2021-04-05T09:24:02Z")

</div>

**Description**  
I use zoom sdk in my android app. I setup the meeting from zoom app with the feature “put in the waiting room”. I tried to listen to InMeetingServiceListener to see the ending reason.

When the the app is in waiting room, the host (using zoom app) admits the user (from android sdk), the InMeetingServiceListener throws the event onMeetingLeaveComplete with the meetingEndReason = 0. (meaning END\_BY\_SELF). I don’t know if it is an error, or it is your feature. But it’s kind of weird for me.  
**Error**  
Bellow is the log I capture from MeetingServiceListener and InMeetingServiceListener

```auto
Meeting state is changed to MEETING_STATUS_CONNECTING error 0 internal error 0
Meeting state is changed to MEETING_STATUS_IN_WAITING_ROOM error 0 internal error 0
Meeting state is changed to MEETING_STATUS_RECONNECTING error 0 internal error 0
(I admit the user who is in the android sdk app in here)
onMeetingLeaveComplete zoomMeetingEndReason 0
Meeting state is changed to MEETING_STATUS_IDLE error 0 internal error 0
Meeting state is changed to MEETING_STATUS_CONNECTING error 0 internal error 0
Meeting state is changed to MEETING_STATUS_INMEETING error 0 internal error 0

```

**Which Web Client SDK version?**  
Knowing the version can help us to identify your issue faster. [e.g. 1.9.0]

**Device (please complete the following information):**

- Device: [e.g. iPhone 12]
- OS: [e.g. android 7.1]
- Android app (api 29)

---

<div class="post-metadata">

**Author:** ![jon.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jon.zoom/32/13495_2.png) [@jon.zoom](https://devforum.zoom.us/u/jon.zoom)\
**Post date:** [April 5, 2021, 10:25pm UTC](https://devforum.zoom.us/t/zoom-android-sdk-leaves-meeting-after-host-admit-the-user/47244/2 "2021-04-05T22:25:11Z")

</div>

Hi @hoang_nguyen, thanks for using the dev forum.

The behavior you are observing is correct. When you are admitted to the main meeting from the waiting room, you are actually leaving one meeting instance in order to join the main meeting instance.

Thanks!

---

<div class="post-metadata">

**Author:** ![hoang\_nguyen](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/hoang_nguyen/32/18526_2.png) [@hoang\_nguyen](https://devforum.zoom.us/u/hoang_nguyen)\
**Post date:** [April 6, 2021, 3:20am UTC](https://devforum.zoom.us/t/zoom-android-sdk-leaves-meeting-after-host-admit-the-user/47244/3 "2021-04-06T03:20:21Z")

</div>

@jon.zoom So, how can I know the actual ending reason, because it returns the ending code is 0 (mean end by user), but actually the user does not do any thing. My expectation is the ending reason should be the other one. Or the event onMeetingLeaveComplete should not occur.

---

<div class="post-metadata">

**Author:** ![jon.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jon.zoom/32/13495_2.png) [@jon.zoom](https://devforum.zoom.us/u/jon.zoom)\
**Post date:** [April 6, 2021, 5:37pm UTC](https://devforum.zoom.us/t/zoom-android-sdk-leaves-meeting-after-host-admit-the-user/47244/4 "2021-04-06T17:37:25Z")

</div>

Hi @hoang_nguyen,

When you are admitted to the main meeting, you are actually leaving a meeting and joining the main meeting. If you need to differentiate between leaving the main meeting or leaving the waiting room, you can watch for whether or not you’ve seen the `MEETING_STATUS_IN_WAITING_ROOM` status.

Thanks!

---

<div class="post-metadata">

**Author:** ![hoang\_nguyen](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/hoang_nguyen/32/18526_2.png) [@hoang\_nguyen](https://devforum.zoom.us/u/hoang_nguyen)\
**Post date:** [April 9, 2021, 3:14am UTC](https://devforum.zoom.us/t/zoom-android-sdk-leaves-meeting-after-host-admit-the-user/47244/5 "2021-04-09T03:14:07Z")

</div>

Thanks, @jon.zoom. But if I am in the waiting room then I call leaveCurrentMeeting function, or the user click on end meeting button, it would be the same, right. I cannot know which one happened.

---

<div class="post-metadata">

**Author:** ![jon.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jon.zoom/32/13495_2.png) [@jon.zoom](https://devforum.zoom.us/u/jon.zoom)\
**Post date:** [April 9, 2021, 4:20pm UTC](https://devforum.zoom.us/t/zoom-android-sdk-leaves-meeting-after-host-admit-the-user/47244/6 "2021-04-09T16:20:49Z")

</div>

Hi @hoang_nguyen,

In both instances, there is a point in time at which the user is no longer connected to any meeting. The only difference will come from when the user joins the main meeting after a short delay. Can you provide some context around your use case so that I can see if there is another approach that could work for you?

Thanks!

---

<div class="post-metadata">

**Author:** ![hoang\_nguyen](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/hoang_nguyen/32/18526_2.png) [@hoang\_nguyen](https://devforum.zoom.us/u/hoang_nguyen)\
**Post date:** [April 9, 2021, 11:15pm UTC](https://devforum.zoom.us/t/zoom-android-sdk-leaves-meeting-after-host-admit-the-user/47244/7 "2021-04-09T23:15:36Z")

</div>

In my case, if the call manually ended by user. My application will end another process. Let’s say the X process. So I look at the `onMeetingLeaveComplete` event to check the reason. First I check if the endReason == 0 (meaning END\_BY\_SELF), but still have the problem like I explained. Now, I probably solved the problem but don’t know if there is any case that goes out of my logic.

So I check the `onMeetingStatusChanged` event.

```auto

switch (zoomMeetingState) {
    case MEETING_STATUS_IN_WAITING_ROOM:
        meetingState = MyEnum.MEETING_STATE_IN_WAITING_ROOM;
        break;
    case MEETING_STATUS_RECONNECTING:
        meetingState = MyEnum.MEETING_STATUS_RECONNECTING;
        if (meetingState ==MyEnum.MEETING_STATE_IN_WAITING_ROOM) {
            meetingState = MyEnum.MEETING_STATE_LEAVING_WAITING_ROOM;
        }
        break;

```

Then I check on the onMeetingLeaveComplete event and check if it is leaving the waiting, I will not end the X process.

```auto
if (meetingState == MyEnum.MEETING_STATE_LEAVING_WAITING_ROOM) {
    Log.i(TAG, "Leave the waiting room, waiting to join in the main meeting");
    return;
} else {
    // check some other variables to end the xProcess
    xProcess.finish();
}

```

---

<div class="post-metadata">

**Author:** ![jon.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jon.zoom/32/13495_2.png) [@jon.zoom](https://devforum.zoom.us/u/jon.zoom)\
**Post date:** [April 12, 2021, 3:54pm UTC](https://devforum.zoom.us/t/zoom-android-sdk-leaves-meeting-after-host-admit-the-user/47244/8 "2021-04-12T15:54:32Z")

</div>

Hi @hoang_nguyen,

That’s good to hear you found a potential workaround! Since there are a lot of possible meeting statuses, this approach could still be tricky to handle. A couple of edge cases I can think of off the top of my head are: 1. The user disconnects from the waiting room due to network connectivity issues and then reconnects to the waiting room, and 2. The user loses the meeting connection before attempting to join the main meeting but after leaving the waiting room.

Thanks!

---

<div class="post-metadata">

**Author:** ![vuzix\_greg](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/vuzix_greg/32/45663_2.png) [@vuzix\_greg](https://devforum.zoom.us/u/vuzix_greg)\
**Post date:** [April 12, 2021, 8:37pm UTC](https://devforum.zoom.us/t/zoom-android-sdk-leaves-meeting-after-host-admit-the-user/47244/9 "2021-04-12T20:37:55Z")

</div>

I faced the same problem a while back. What I do is watch for MEETING\_STATUS\_DISCONNECTING to come through. If I see that, I set a flag for later so that when MEETING\_STATUS\_IDLE comes through I check to see if MEETING\_STATUS\_DISCONNECTING came through right before it. That way I can tell the difference between transitioning from waiting room to actual meeting and leaving the meeting completely. So far it’s continued to work well for me. Not sure if it helps, but thought I’d share.

---

<div class="post-metadata">

**Author:** ![hoang\_nguyen](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/hoang_nguyen/32/18526_2.png) [@hoang\_nguyen](https://devforum.zoom.us/u/hoang_nguyen)\
**Post date:** [April 15, 2021, 3:06am UTC](https://devforum.zoom.us/t/zoom-android-sdk-leaves-meeting-after-host-admit-the-user/47244/10 "2021-04-15T03:06:56Z")

</div>

Thanks for your advice, I think, it is better for us, if zoom team can improve the flow of this case so far.

---

<div class="post-metadata">

**Author:** ![hoang\_nguyen](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/hoang_nguyen/32/18526_2.png) [@hoang\_nguyen](https://devforum.zoom.us/u/hoang_nguyen)\
**Post date:** [April 15, 2021, 3:16am UTC](https://devforum.zoom.us/t/zoom-android-sdk-leaves-meeting-after-host-admit-the-user/47244/11 "2021-04-15T03:16:44Z")

</div>

Thanks for your suggestion. I think this is a good solution.

---

<div class="post-metadata">

**Author:** ![hoang\_nguyen](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/hoang_nguyen/32/18526_2.png) [@hoang\_nguyen](https://devforum.zoom.us/u/hoang_nguyen)\
**Post date:** [April 15, 2021, 3:19am UTC](https://devforum.zoom.us/t/zoom-android-sdk-leaves-meeting-after-host-admit-the-user/47244/12 "2021-04-15T03:19:42Z")

</div>

do you have any solution, that can completely solve this issue?

---

<div class="post-metadata">

**Author:** ![jon.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jon.zoom/32/13495_2.png) [@jon.zoom](https://devforum.zoom.us/u/jon.zoom)\
**Post date:** [April 15, 2021, 4:44pm UTC](https://devforum.zoom.us/t/zoom-android-sdk-leaves-meeting-after-host-admit-the-user/47244/13 "2021-04-15T16:44:46Z")

</div>

Hi @hoang_nguyen,

Your best bet seems to be implementing some sort of state management in your app to handle this. The recommendation made by @vuzix_greg could also be helpful.

It is unlikely that there will be any changes to this flow, since it is a result of how the back end handles the waiting room.

Thanks!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [May 16, 2021, 2:45am UTC](https://devforum.zoom.us/t/zoom-android-sdk-leaves-meeting-after-host-admit-the-user/47244/14 "2021-05-16T02:45:16Z")

</div>

Closed on May 16, 2021, 2:45am UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
