# How to cancel joining a session?

**URL:** <https://devforum.zoom.us/t/how-to-cancel-joining-a-session/142469>\
**Category:** Video SDK\
**Tags:** android\
**Created:** [March 16, 2026, 10:37pm UTC](https://devforum.zoom.us/t/how-to-cancel-joining-a-session/142469 "2026-03-16T22:37:41Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael42](https://avatars.discourse-cdn.com/v4/letter/m/5f8ce5/32.png) [@Michael42](https://devforum.zoom.us/u/Michael42)\
**Post date:** [March 16, 2026, 10:37pm UTC](https://devforum.zoom.us/t/how-to-cancel-joining-a-session/142469/1 "2026-03-16T22:37:41Z")

</div>

### 

**Video SDK Type and Version**

Android 2.2.5, but applicable to newer.

**Description**  
After calling `sdk.joinSession(sessionContext)`how can I cancel the join?

An example use case is where a timeout is implemented if the session takes a long time to join. We’d like to know that the sdk won’t connect to a session later on.

An alternative situation, a user initiates joining a call, but then navigates back and as the view is destructed the cleanup would have called `sdk.leaveSession(false)`. Would that cancel an in-progress `joinSession` or would we end up with an orphaned session?

Thanks,  
Michael

---

<div class="post-metadata">

**Author:** ![Michael42](https://avatars.discourse-cdn.com/v4/letter/m/5f8ce5/32.png) [@Michael42](https://devforum.zoom.us/u/Michael42)\
**Post date:** [March 26, 2026, 9:51am UTC](https://devforum.zoom.us/t/how-to-cancel-joining-a-session/142469/2 "2026-03-26T09:51:32Z")

</div>

@vic.yang is this something you can comment on?  
Thanks,  
Michael

---

<div class="post-metadata">

**Author:** ![vic.yang](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/vic.yang/32/24656_2.png) [@vic.yang](https://devforum.zoom.us/u/vic.yang)\
**Post date:** [March 26, 2026, 10:54am UTC](https://devforum.zoom.us/t/how-to-cancel-joining-a-session/142469/3 "2026-03-26T10:54:32Z")

</div>

Hi @Michael42

Thanks for your feedback.

Since I am not very experienced in Video SDK Android, @ticorrian.heard could you help take a look?

Thanks  
Vic

---

<div class="post-metadata">

**Author:** ![ticorrian.heard](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/ticorrian.heard/32/70213_2.png) [@ticorrian.heard](https://devforum.zoom.us/u/ticorrian.heard)\
**Post date:** [March 29, 2026, 3:39pm UTC](https://devforum.zoom.us/t/how-to-cancel-joining-a-session/142469/4 "2026-03-29T15:39:06Z")

</div>

Hi @Michael42 the connection to the Zoom sessions follows nearly the same flow as the web. There is no explicit method for cancelling the join but if the connecting client is disconnect due to a component being destroyed, the connection to the session would not complete. If the connection does complete (i.e you receive the onSessionJoin message in your listener), the session uses keep alives to keep the user connected. If they are disconnected, there may be a delay before the actual user is automatically disconnected by the server.

---

<div class="post-metadata">

**Author:** ![Michael42](https://avatars.discourse-cdn.com/v4/letter/m/5f8ce5/32.png) [@Michael42](https://devforum.zoom.us/u/Michael42)\
**Post date:** [March 30, 2026, 4:23pm UTC](https://devforum.zoom.us/t/how-to-cancel-joining-a-session/142469/5 "2026-03-30T16:23:31Z")

</div>

Thanks @ticorrian.heard. Suppose we hit a race condition where a component is destroyed just as the connection succeeds, I’m worried about the connection succeeding but the code to do any cleanup has just been destroyed, leaving an orphaned session running. Am I right that all the zoom listener callbacks will run on the main thread? So if the component is destroyed on the main thread then that won’t be a concern?

If that’s not the case, I’d probably architect a session manager that is long lived and holds the listeners. Then I can try joining the session, and if we have a timeout or the user navigates back, the view will be destroyed but we’ll keep the handle on the session until either the connection fails and fires the onError listener, or succeeds in which case the session manager can immediately leave.

---

<div class="post-metadata">

**Author:** ![ticorrian.heard](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/ticorrian.heard/32/70213_2.png) [@ticorrian.heard](https://devforum.zoom.us/u/ticorrian.heard)\
**Post date:** [April 1, 2026, 4:37pm UTC](https://devforum.zoom.us/t/how-to-cancel-joining-a-session/142469/6 "2026-04-01T16:37:49Z")

</div>

Good question, the SDK and all public methods must be called on the main thread. The listeners callbacks I believe run on the main thread as well but I can double check that for you.

---

<div class="post-metadata">

**Author:** ![Michael42](https://avatars.discourse-cdn.com/v4/letter/m/5f8ce5/32.png) [@Michael42](https://devforum.zoom.us/u/Michael42)\
**Post date:** [April 6, 2026, 1:18pm UTC](https://devforum.zoom.us/t/how-to-cancel-joining-a-session/142469/7 "2026-04-06T13:18:51Z")

</div>

Hi, were you able to check that?

---

<div class="post-metadata">

**Author:** ![ticorrian.heard](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/ticorrian.heard/32/70213_2.png) [@ticorrian.heard](https://devforum.zoom.us/u/ticorrian.heard)\
**Post date:** [April 6, 2026, 6:15pm UTC](https://devforum.zoom.us/t/how-to-cancel-joining-a-session/142469/8 "2026-04-06T18:15:56Z")

</div>

Hi @Michael42 sorry for the delay, yes I confirmed that the callbacks will happen on main thread.

---

<div class="post-metadata">

**Author:** ![Michael42](https://avatars.discourse-cdn.com/v4/letter/m/5f8ce5/32.png) [@Michael42](https://devforum.zoom.us/u/Michael42)\
**Post date:** [April 7, 2026, 7:25am UTC](https://devforum.zoom.us/t/how-to-cancel-joining-a-session/142469/9 "2026-04-07T07:25:35Z")

</div>

Great, thank you very much!
