# Zoom's \`MeetingActivity\` immediately destroys itself when backgrounded

**URL:** <https://devforum.zoom.us/t/zooms-meetingactivity-immediately-destroys-itself-when-backgrounded/26575>\
**Category:** Android\
**Created:** [August 7, 2020, 8:18pm UTC](https://devforum.zoom.us/t/zooms-meetingactivity-immediately-destroys-itself-when-backgrounded/26575 "2020-08-07T20:18:13Z")\
**Posts on this page:** 6\
**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:** [August 7, 2020, 8:18pm UTC](https://devforum.zoom.us/t/zooms-meetingactivity-immediately-destroys-itself-when-backgrounded/26575/1 "2020-08-07T20:18:13Z")

</div>

**Description**  
Zoom’s `MeetingActivity` will destroy itself immediately when backgrounded. This deviates from normal Android application behavior.

Consider the following custom `MeetingActivity`, registered in the `config.xml` file:

```auto
class CustomZoomActivity : MeetingActivity() {

    override fun onBackPressed() {
        // Zoom's MeetingActivity appears to close the
        // application when back is pressed by default.
        // Override this behavior.
        finish()
    }

    override fun onPause() { super.onPause() }

    override fun onStop() { super.onStop() }

    override fun onDestroy() { super.onDestroy() }
}

```

If a user joins a meeting and then backgrounds the application (by either clicking the home button, the recent apps button, etc.) the `CustomMeetingActivity`/`MeetingActivity` will immediately go through `onPause()`, `onStop`, _ **and** _ `onDestroy()`. Thus, when the application returns to the foreground, the relevant meeting `Activity` is closed.

As mentioned, this sort of behavior deviates from the basic lifecycle of Android applications, and results in a very odd user experience. Note that the user does not even need to switch apps for this issue to occur; simply clicking the “recent apps” button and immediately going back to the same app will also produce this issue.

**Questions:**

1. Why does the relevant meeting `Activity` close itself when backgrounded?
2. How can this issue be resolved?

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

**To Reproduce**  
Steps to reproduce the behavior:

1. Create and register an `Activity` for use as the meeting `Activity`, as shown above.
2. Join an existing meeting (either by entering a waiting room or directly entering a meeting).
3. Background the application by any means, and then immediately return to the application to observe the issue.

**Smartphone:**

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

**Additional context**  
This matter is rather urgent, a prompt response would be highly appreciated.

---

<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 8, 2020, 12:44am UTC](https://devforum.zoom.us/t/zooms-meetingactivity-immediately-destroys-itself-when-backgrounded/26575/2 "2020-08-08T00:44:11Z")

</div>

Hi @caleb.c,

Thanks for the post. Are you using Zoom default UI or Custom UI? I just tried to reproduce this issue with our demo app but when I put the app in the background and then bring it foreground, I am still able to continue the meeting in both modes.

Any logs you could provide so that we could investigate what is going on?

Thanks!

---

<div class="post-metadata">

**Author:** ![ociuzteam](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/ociuzteam/32/36996_2.png) [@ociuzteam](https://devforum.zoom.us/u/ociuzteam)\
**Post date:** [April 25, 2022, 12:21pm UTC](https://devforum.zoom.us/t/zooms-meetingactivity-immediately-destroys-itself-when-backgrounded/26575/3 "2022-04-25T12:21:15Z")

</div>

Hi, I am using zoom default UI. I’m also facing the same issue (destroys when click home button) for devices with android version 11(Vivo Y73, Samsung M30S).Zoom SDK version v5.10.1

---

<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 26, 2022, 6:57pm UTC](https://devforum.zoom.us/t/zooms-meetingactivity-immediately-destroys-itself-when-backgrounded/26575/4 "2022-04-26T18:57:46Z")

</div>

Hi @ociuzteam, thanks for using the dev forum.

Sorry to hear you’re running into a similar issue. After some testing on my side, I was unable to reproduce the behavior you are seeing. Are you seeing any other behavior aside from the `onDestroy` callback being triggered?

Thanks!

---

<div class="post-metadata">

**Author:** ![ociuzteam](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/ociuzteam/32/36996_2.png) [@ociuzteam](https://devforum.zoom.us/u/ociuzteam)\
**Post date:** [April 27, 2022, 5:06am UTC](https://devforum.zoom.us/t/zooms-meetingactivity-immediately-destroys-itself-when-backgrounded/26575/5 "2022-04-27T05:06:22Z")

</div>

Thank you for the response. There is no other important issues. When press home button(in device), exits from Meeting Activity instead of minimizing.

---

<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 27, 2022, 7:50pm UTC](https://devforum.zoom.us/t/zooms-meetingactivity-immediately-destroys-itself-when-backgrounded/26575/6 "2022-04-27T19:50:26Z")

</div>

Hi @ociuzteam,

The Android meeting SDK does not handle automatically showing the mini meeting window when your app is backgrounded like the Zoom client does. You can call [`showMiniMeetingWindow`](https://marketplacefront.zoom.us/sdk/meeting/android/us/zoom/sdk/ZoomUIService.html#showMiniMeetingWindow()) to minimize the meeting UI programmatically and [`hideMiniMeetingWindow`](https://marketplacefront.zoom.us/sdk/meeting/android/us/zoom/sdk/ZoomUIService.html#hideMiniMeetingWindow()) to hide it, which can help with imitating the Zoom client’s behavior.

Thanks!
