# Back button behavior when in a meeting

**URL:** <https://devforum.zoom.us/t/back-button-behavior-when-in-a-meeting/24216>\
**Category:** Android\
**Created:** [July 15, 2020, 5:35pm UTC](https://devforum.zoom.us/t/back-button-behavior-when-in-a-meeting/24216 "2020-07-15T17:35:50Z")\
**Posts on this page:** 12\
**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 15, 2020, 5:35pm UTC](https://devforum.zoom.us/t/back-button-behavior-when-in-a-meeting/24216/1 "2020-07-15T17:35:50Z")

</div>

**Description**  
I’d like to get some clarification on the back button behavior when using the Zoom SDK. If I join a meeting via `meetingService.joinMeetingWithParams()` from my own Activity, Zoom launches it’s own Activity (I believe it’s called `ConfActivityNormal ` internally). If I press the back button at this point, the entire application will be closed as it’s sent to the background. However, the meeting still seems to be active and the user does not leave the meeting.

The other scenario is where I join a meeting via `meetingService.joinMeetingWithParams()` from my own Activity, but have another custom Activity specified in `config.xml` via with the following:

```
<string name="zm_config_conf_activity">com.example.CustomZoomActivity</string>

```

In `CustomZoomActivity`, in order to prevent the app from closing when the back button is pressed, I have to override `onBackPressed` and then call `finish()`. This will successfully go back to the previous Activity without closing the app, however the `onMeetingStatusChanged` listener shows the meeting is still active.

**Summary of questions:**

1. Why does the entire application close when the back button is pressed when using the default Zoom Activity?
2. How can the back button behavior be properly handled? Is the way I’ve suggested in the description the correct way?
3. Why does the user who joined the meeting not _leave_ the meeting when the back button is pressed, and how can that behavior be achieved?

Specific, itemized answers to these questions are appreciated.

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

**To Reproduce**  
See description.

**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:** [July 17, 2020, 11:28pm UTC](https://devforum.zoom.us/t/back-button-behavior-when-in-a-meeting/24216/2 "2020-07-17T23:28:50Z")

</div>

Hi @caleb.c,

Thanks for the post. Regarding your questions:

> [@caleb.c](#):
>
> Why does the entire application close when the back button is pressed when using the default Zoom Activity?

If you are using the Zoom default UI, when you press the back button, it will bring the app to the background.

> [@caleb.c](#):
>
> How can the back button behavior be properly handled? Is the way I’ve suggested in the description the correct way?

The way you are mentioning is the proper way to override the back button action.

> [@caleb.c](#):
>
> Why does the user who joined the meeting not _leave_ the meeting when the back button is pressed, and how can that behavior be achieved?

Calling `finish()` is not going to leave the meeting. In order to leave the meeting, you will need to call `InMeetingService.leaveCurrentMeeting` before calling `finish()` .

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:** [July 20, 2020, 4:39pm UTC](https://devforum.zoom.us/t/back-button-behavior-when-in-a-meeting/24216/3 "2020-07-20T16:39:00Z")

</div>

@carson.zoom

I appreciate the response. Regarding:

> [@carson.zoom](#):
>
> > [@caleb.c](#):
> >
> > Why does the entire application close when the back button is pressed when using the default Zoom Activity?
> 
> If you are using the Zoom default UI, when you press the back button, it will bring the app to the background.

My question is _why_ it backgrounds the app. That’s fairly odd behavior, so I’m wondering why the decision was made to have that be the default.

---

<div class="post-metadata">

**Author:** ![harmanbeer007](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/harmanbeer007/32/12284_2.png) [@harmanbeer007](https://devforum.zoom.us/u/harmanbeer007)\
**Post date:** [July 22, 2020, 1:46pm UTC](https://devforum.zoom.us/t/back-button-behavior-when-in-a-meeting/24216/4 "2020-07-22T13:46:50Z")

</div>

Facing the same Problem  
I am using default UI and extending  
So how i can achive this with default UI and custom OnBackPress

---

<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:15am UTC](https://devforum.zoom.us/t/back-button-behavior-when-in-a-meeting/24216/5 "2020-08-01T01:15:09Z")

</div>

Hi @caleb.c,

Thanks for the reply. I do not know how this design comes from but I have forwarded your feedback to the engineering team for consideration. Thanks for the feedback.

---

<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:16am UTC](https://devforum.zoom.us/t/back-button-behavior-when-in-a-meeting/24216/6 "2020-08-01T01:16:16Z")

</div>

Hi @harmanbeer007,

Thanks for using Zoom SDK. Please refer to the answer here: [Onbackpress to go out of application](https://devforum.zoom.us/t/onbackpress-to-go-out-of-application/9297/4)

Thanks!

---

<div class="post-metadata">

**Author:** ![akshay.jadhav](https://avatars.discourse-cdn.com/v4/letter/a/71e660/32.png) [@akshay.jadhav](https://devforum.zoom.us/u/akshay.jadhav)\
**Post date:** [March 15, 2022, 9:44am UTC](https://devforum.zoom.us/t/back-button-behavior-when-in-a-meeting/24216/7 "2022-03-15T09:44:51Z")

</div>

The above solution not working for me…I Used the kotlin language .

---

<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:** [March 15, 2022, 6:49pm UTC](https://devforum.zoom.us/t/back-button-behavior-when-in-a-meeting/24216/8 "2022-03-15T18:49:16Z")

</div>

Hi @akshay.jadhav, thanks for using the dev forum.

Can you provide some additional information about your implementation? It isn’t clear what specific changes you have made or what behavior you are seeing.

Thanks!

---

<div class="post-metadata">

**Author:** ![akshay.jadhav](https://avatars.discourse-cdn.com/v4/letter/a/71e660/32.png) [@akshay.jadhav](https://devforum.zoom.us/u/akshay.jadhav)\
**Post date:** [March 29, 2022, 10:08am UTC](https://devforum.zoom.us/t/back-button-behavior-when-in-a-meeting/24216/9 "2022-03-29T10:08:54Z")

</div>

1. Why does the entire application close when the back button is pressed when using the default Zoom Activity?
2. How can the back button behavior be properly handled? Is the way I’ve suggested in the description the correct way?
3. Why does the user who joined the meeting not _leave_ the meeting when the back button is pressed, and how can that behavior be achieved?

---

<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:** [March 29, 2022, 7:59pm UTC](https://devforum.zoom.us/t/back-button-behavior-when-in-a-meeting/24216/10 "2022-03-29T19:59:51Z")

</div>

Hi @akshay.jadhav,

1. This is how the Android platform behaves. If you press back on the last `Activity` in a stack, the app will exit.
2. Yes, the previously suggested method in this topic is still the recommended approach.
3. The meeting connection will remain active unless the app’s process ends or the meeting is left manually. You can achieve that by calling [`leaveCurrentMeeting`](https://marketplacefront.zoom.us/sdk/meeting/android/us/zoom/sdk/InMeetingService.html#leaveCurrentMeeting(boolean)) to leave the meeting when the back button is pressed.

Thanks!

---

<div class="post-metadata">

**Author:** ![akshay.jadhav](https://avatars.discourse-cdn.com/v4/letter/a/71e660/32.png) [@akshay.jadhav](https://devforum.zoom.us/u/akshay.jadhav)\
**Post date:** [March 30, 2022, 4:30am UTC](https://devforum.zoom.us/t/back-button-behavior-when-in-a-meeting/24216/11 "2022-03-30T04:30:58Z")

</div>

[quote=“akshay.jadhav, post:9, topic:24216”]

[/quote]’=  
Why does the entire application close when the back button is pressed.I need a solution for the onBackPress .How do I handle the back button when user in meeting.

---

<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:** [March 30, 2022, 9:30pm UTC](https://devforum.zoom.us/t/back-button-behavior-when-in-a-meeting/24216/12 "2022-03-30T21:30:23Z")

</div>

Hi @akshay.jadhav,

This question was answered in my previous reply. If you have any specific follow-up questions or are unclear on my response, please let me know what is missing and I’ll be happy to help. 🙂

Thanks!
