# onZoomSDKLoginResult has an old copy of the variable

**URL:** <https://devforum.zoom.us/t/onzoomsdkloginresult-has-an-old-copy-of-the-variable/51904>\
**Category:** Android\
**Created:** [June 7, 2021, 12:35pm UTC](https://devforum.zoom.us/t/onzoomsdkloginresult-has-an-old-copy-of-the-variable/51904 "2021-06-07T12:35:08Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![nikithabagalkoti](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/nikithabagalkoti/32/27545_2.png) [@nikithabagalkoti](https://devforum.zoom.us/u/nikithabagalkoti)\
**Post date:** [June 7, 2021, 12:35pm UTC](https://devforum.zoom.us/t/onzoomsdkloginresult-has-an-old-copy-of-the-variable/51904/1 "2021-06-07T12:35:08Z")

</div>

**Description**  
On successful login, i have added the listener - ZoomSDK.getInstance().addAuthenticationListener(authListener); which calls the onZoomSDKLoginResult. I am checking for a variable that is updated in the onCreate of that activity. But it is having an old value. After a few seconds, i see that onZoomSDKLoginResult is called and see that the variable is updated now. Could you let me know how to get the updated value for the first time?

int result = ZoomSDK.getInstance().loginWithZoom(username, password);  
if (result == ZoomApiError.ZOOM\_API\_ERROR\_SUCCESS) {  
// Request executed, listen for result to start meeting  
ZoomSDK.getInstance().addAuthenticationListener(authListener);  
}

**Which Mobile Client SDK version?**  
v5.0.24437.0708

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

- Device: Google Pixel
- OS: Android 10

---

<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:** [June 7, 2021, 9:39pm UTC](https://devforum.zoom.us/t/onzoomsdkloginresult-has-an-old-copy-of-the-variable/51904/2 "2021-06-07T21:39:12Z")

</div>

Hi @nikithabagalkoti, thanks for the post.

Can you please clarify which variable you are referring to? Is it something provided by the SDK that is incorrect?

Thanks!

---

<div class="post-metadata">

**Author:** ![nikithabagalkoti](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/nikithabagalkoti/32/27545_2.png) [@nikithabagalkoti](https://devforum.zoom.us/u/nikithabagalkoti)\
**Post date:** [June 8, 2021, 12:54am UTC](https://devforum.zoom.us/t/onzoomsdkloginresult-has-an-old-copy-of-the-variable/51904/3 "2021-06-08T00:54:56Z")

</div>

Hi Jon,

It’s not a variable provided by SDK. Here is the scenario.

1. I have an adapter with the list of names for which i can start a instant zoom meeting or schedule it for later.
2. I select a name from the list to start the meeting now and the zoom activity is started using the intent with booleanExtra as “now”.
3. I see that zoom activity has the value for now set to true and instant meeting is started.
4. Next time I choose the option of scheduling the meeting later, following things happen. onZoomSDKLoginResult shows the old value for intent.getBooleanExtra. In the intent.getBooleanExtra i am still getting now as true.  
onZoomSDKLoginResult is called multiple times and i get the updated value for now as false later.

In the **onCreate method of the new Zoom activity** , i am getting the updated values properly sent from the adapter.

Scenario 2.  
I am using an alert dialog from the onZoomSDKLoginResult to schedule a meeting later. Alert dialog uses the context which works well the first time.  
On opening the alert dialog for the 2nd time, context isn’t updated in the onZoomSDKLoginResult function. Application crashes with the error - **unable to add window – token null is not valid; is your activity running? This crash is usually caused by your app trying to display a dialogue using a previously finished Activity as a context.**

Hope this is clear. Thanks in advance.

---

<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:** [June 8, 2021, 4:59pm UTC](https://devforum.zoom.us/t/onzoomsdkloginresult-has-an-old-copy-of-the-variable/51904/4 "2021-06-08T16:59:57Z")

</div>

Hi @nikithabagalkoti,

Thank you for clarifying. It seems like this is an issue with the UI you are defining yourself, and is not directly related to the SDK. I understand that you are creating a dialog from one of the SDK’s callbacks, but the dialog would be defined in your app, so the SDK is not responsible for its behavior.

Thanks!

---

<div class="post-metadata">

**Author:** ![nikithabagalkoti](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/nikithabagalkoti/32/27545_2.png) [@nikithabagalkoti](https://devforum.zoom.us/u/nikithabagalkoti)\
**Post date:** [June 9, 2021, 12:49am UTC](https://devforum.zoom.us/t/onzoomsdkloginresult-has-an-old-copy-of-the-variable/51904/5 "2021-06-09T00:49:04Z")

</div>

Hi Jon.lieblich,

Thanks for the reply. Both the scenarios work outside your callback.  
Scenario 1 - i get the updated booleanExtra in the onCreate method and not in your callback.  
Scenario 2 - i create a dialog outside the callback and works everytime. There is no crash.

Could you please re-confirm? Thanks in advance.

---

<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:** [June 9, 2021, 5:16pm UTC](https://devforum.zoom.us/t/onzoomsdkloginresult-has-an-old-copy-of-the-variable/51904/6 "2021-06-09T17:16:57Z")

</div>

Hi @nikithabagalkoti,

If this is being caused by a dialog that you are creating and not one made by the SDK, this means that it is an issue with the state of your application. The SDK cannot control what the state of your application will be by the time it receives this callback.

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:** [July 10, 2021, 3:17am UTC](https://devforum.zoom.us/t/onzoomsdkloginresult-has-an-old-copy-of-the-variable/51904/7 "2021-07-10T03:17:43Z")

</div>

Closed on July 10, 2021, 3:17am UTC

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