# Capturing user "leave meeting" events

**URL:** <https://devforum.zoom.us/t/capturing-user-leave-meeting-events/25659>\
**Category:** Android\
**Created:** [July 29, 2020, 11:23pm UTC](https://devforum.zoom.us/t/capturing-user-leave-meeting-events/25659 "2020-07-29T23:23:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![caleb.c](https://avatars.discourse-cdn.com/v4/letter/c/b2d939/32.png) [@caleb.c](https://devforum.zoom.us/u/caleb.c)\
**Post date:** [July 29, 2020, 11:23pm UTC](https://devforum.zoom.us/t/capturing-user-leave-meeting-events/25659/1 "2020-07-29T23:23:28Z")

</div>

**Description**  
We’d like to determine when and _how_ a user leaves a meeting by either

1. The user clicking the red “Leave” button in the meeting
2. The host ending the meeting
3. Programmatically leaving the meeting via `meetingService.leaveCurrentMeeting()`

We’ve implemented two different listeners in an attempt to capture these three events, namely the `MeetingServiceListener` and the `InMeetingServiceListener`, however these callbacks have produced much confusion.

**Questions:**

1. Is there a listener to listen for click events on the red, in meeting “Leave” button?

2. Consider the following log output:

3. Finally, exiting the meeting via the back button (after overriding the default behavior, see [back-button-behavior-when-in-a-meeting](https://devforum.zoom.us/t/back-button-behavior-when-in-a-meeting/24216/4)) seems to require that a `leaveCurrentMeeting()` function be invoked. How can we differentiate between leaving a meeting via that function and the other ways described above?

**Which version?**  
SDK version v5.0.24433.0616

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

- Device: Pixel Emulator
- OS: Android
- Version: API 29

---

<div class="post-metadata">

**Author:** ![carson.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/carson.zoom/32/785_2.png) [@carson.zoom](https://devforum.zoom.us/u/carson.zoom)\
**Post date:** [August 1, 2020, 1:06am UTC](https://devforum.zoom.us/t/capturing-user-leave-meeting-events/25659/2 "2020-08-01T01:06:11Z")

</div>

Hi @caleb.c,

Thanks for the post. Regarding your questions:

1). You could override the listener `onClickEndButton` for this purpose.  
2). When a user has been admitted from the waiting room, the user will leave the meeting and then rejoin the main section. This is by design and inherits from the Zoom client.  
3). You could differentiate the cases by overriding the `onClickEndButton` and `onBackPressed`

Hope this helps. Thanks!

---

<div class="post-metadata">

**Author:** ![caleb.c](https://avatars.discourse-cdn.com/v4/letter/c/b2d939/32.png) [@caleb.c](https://devforum.zoom.us/u/caleb.c)\
**Post date:** [August 3, 2020, 5:12pm UTC](https://devforum.zoom.us/t/capturing-user-leave-meeting-events/25659/3 "2020-08-03T17:12:43Z")

</div>

@carson.zoom

I apologize, I should have been more clear. I found the `onClickEndButton` callback, but that is invoked when the user clicks the “Leave” button:

 ![leavebtn](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/2X/e/e58d70f1097588fd51dbee32fa9bf24e72082091.png)

Clicking this button doesn’t leave the meeting, it simply shows the secondary “Leave Meeting” button:

 ![bigleavebtn](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/2X/e/ec216618b79b35eecbb6f455cbe6d3330593d116.png)

This secondary button is the one I wish to listen to, as clicking this button causes the user to leave the meeting. There exists another callback, `onClickLeave`, however this appears to duplicate the functionality of the `onClickEndButton` callback and is _not_ invoked when this secondary button is clicked. How can I listen for clicks of this button?

---

<div class="post-metadata">

**Author:** ![carson.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/carson.zoom/32/785_2.png) [@carson.zoom](https://devforum.zoom.us/u/carson.zoom)\
**Post date:** [August 5, 2020, 6:07am UTC](https://devforum.zoom.us/t/capturing-user-leave-meeting-events/25659/4 "2020-08-05T06:07:17Z")

</div>

Hi @caleb.c,

Thanks for the reply and the detailed explanation. Understand, currently we do not have a listener just for the secondary “Leave Meeting” button. I will forward this as a feature request to the engineering team.

Thanks!
