# Cannot resolve method zoomSDK.initialize(this, APP\_KEY, APP\_SECRET, WEB\_DOMAIN, this);

**URL:** <https://devforum.zoom.us/t/cannot-resolve-method-zoomsdk-initialize-this-app-key-app-secret-web-domain-this/4608>\
**Category:** Android\
**Created:** [June 12, 2019, 2:49pm UTC](https://devforum.zoom.us/t/cannot-resolve-method-zoomsdk-initialize-this-app-key-app-secret-web-domain-this/4608 "2019-06-12T14:49:34Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tobiak](https://avatars.discourse-cdn.com/v4/letter/t/a3d4f5/32.png) [@Tobiak](https://devforum.zoom.us/u/Tobiak)\
**Post date:** [June 12, 2019, 2:49pm UTC](https://devforum.zoom.us/t/cannot-resolve-method-zoomsdk-initialize-this-app-key-app-secret-web-domain-this/4608/1 "2019-06-12T14:49:34Z")

</div>

**Description**  
zoomSDK.initialize(this, APP\_KEY, APP\_SECRET, WEB\_DOMAIN, this); This entire line is in red as seen in screenshot attached. When I hover my mouse on, I see this message: " Cannot resolve method zoomSDK.initialize(this, APP\_KEY, APP\_SECRET, WEB\_DOMAIN, this); "

**Which version?**  
Version: 4.3.47200.0322

**To Reproduce(If applicable)**  
Followed guide at this link: [https://marketplace.zoom.us/docs/sdk/native-sdks/android/build-your-first-zoom-app/join-meeting](https://marketplace.zoom.us/docs/sdk/native-sdks/android/build-your-first-zoom-app/join-meeting)

**Screenshots**

 ![10%20PM](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/2X/9/9d87cdc67aadbffebaca6a18b24baea41c9980d7.png)

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

**Additional context**  
Add any other context about the problem here.

---

<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:** [June 12, 2019, 5:39pm UTC](https://devforum.zoom.us/t/cannot-resolve-method-zoomsdk-initialize-this-app-key-app-secret-web-domain-this/4608/2 "2019-06-12T17:39:43Z")

</div>

Hi Tobiak,  
Thanks for the post and the info. Based on the error message in the screenshot, you are trying to cast the MeetingJoin class to be a ZoomSDKInitializeListener. Please note that the `zoomSDK.initialize` method requires the following parameters(You can refer to the doc for more info: [https://marketplace.zoom.us/docs/sdk/native-sdks/android/mastering-zoom-sdk/sdk-initialization#1-initialize-the-zoom-sdk](https://marketplace.zoom.us/docs/sdk/native-sdks/android/mastering-zoom-sdk/sdk-initialization#1-initialize-the-zoom-sdk)):

```auto
ZoomSDK sdk = ZoomSDK.getInstance();
sdk.initialize(context, APP_KEY, APP_SECRET, (ZoomSDKInitializeListener)this);

```

The `this` in your code indicates the `context`, thus you cannot pass it to the parameter that requires listener.

Hope this helps. Thanks!

---

<div class="post-metadata">

**Author:** ![Tobiak](https://avatars.discourse-cdn.com/v4/letter/t/a3d4f5/32.png) [@Tobiak](https://devforum.zoom.us/u/Tobiak)\
**Post date:** [June 14, 2019, 6:57am UTC](https://devforum.zoom.us/t/cannot-resolve-method-zoomsdk-initialize-this-app-key-app-secret-web-domain-this/4608/3 "2019-06-14T06:57:40Z")

</div>

Thank you for your response. I quite understand that the first Parameter in the method “sdk.initialize()” is not provided the right argument. But can you suggest what should be provided based on this information in my code?

I have just created a new class MainActivity.class instead of MeetingJoin.class :

package com.myapp.virtualmeeting;

import android.app.assist.AssistStructure;  
import android.support.v7.app.AppCompatActivity;  
import android.os.Bundle;  
import us.zoom.sdk.JoinMeetingOptions;  
import us.zoom.sdk.JoinMeetingParams;  
import us.zoom.sdk.MeetingError;  
import us.zoom.sdk.MeetingEvent;  
import us.zoom.sdk.MeetingService;  
import us.zoom.sdk.MeetingServiceListener;  
import us.zoom.sdk.MeetingStatus;  
import us.zoom.sdk.StartMeetingOptions;  
import us.zoom.sdk.ZoomError;  
import us.zoom.sdk.ZoomSDK;  
import us.zoom.sdk.ZoomSDKAuthenticationListener;  
import us.zoom.sdk.ZoomSDKInitializeListener;  
import android.app.Activity;  
import android.app.AlertDialog;  
import android.content.DialogInterface;  
import android.content.Intent;  
import android.content.pm.ActivityInfo;  
import android.os.Bundle;  
import android.util.Log;  
import android.view.View;  
import android.widget.EditText;  
import android.widget.TextView;  
import android.widget.Toast;

import com.myapp.virtualmeeting.R;  
import com.myapp.virtualmeeting.Constants;

import static com.myapp.virtualmeeting.Constants.APP\_KEY;  
import static com.myapp.virtualmeeting.Constants.APP\_SECRET;  
import static com.myapp.virtualmeeting.Constants.WEB\_DOMAIN;  
import android.content.Context;

public class MainActivity extends AppCompatActivity {

```
private EditText mEdtMeetingNo;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    ZoomSDK zoomSDK = ZoomSDK.getInstance();

    mEdtMeetingNo = (EditText)findViewById(R.id.edtMeetingNo);

    if(savedInstanceState == null)
        zoomSDK.initialize(this, APP_KEY, APP_SECRET, (ZoomSDKInitializeListener)this);
}
public void onClickBtnJoinMeeting(View view) {

    // Step 1: Get meeting number from input field.
    String meetingNo = mEdtMeetingNo.getText().toString().trim();
    // Check if the meeting number is empty.
    if(meetingNo.length() == 0) {
        Toast.makeText(this, "You need to enter a meeting number/ vanity id which you want to join.", Toast.LENGTH_LONG).show();
        return;
    }

    // Step 2: Get Zoom SDK instance.
    ZoomSDK zoomSDK = ZoomSDK.getInstance();
    // Check if the zoom SDK is initialized
    if(!zoomSDK.isInitialized()) {
        Toast.makeText(this, "ZoomSDK has not been initialized successfully", Toast.LENGTH_LONG).show();
        return;
    }

    // Step 3: Get meeting service from zoom SDK instance.
    MeetingService meetingService = zoomSDK.getMeetingService();

    // Step 4: Configure meeting options.
    JoinMeetingOptions opts = new JoinMeetingOptions();

    // Some available options
    // opts.no_driving_mode = true;
    // opts.no_invite = true;
    // opts.no_meeting_end_message = true;
    // opts.no_titlebar = true;
    // opts.no_bottom_toolbar = true;
    // opts.no_dial_in_via_phone = true;
    // opts.no_dial_out_to_phone = true;
    // opts.no_disconnect_audio = true;
    // opts.no_share = true;
    // opts.invite_options = InviteOptions.INVITE_VIA_EMAIL + InviteOptions.INVITE_VIA_SMS;
    // opts.no_audio = true;
    // opts.no_video = true;
    // opts.meeting_views_options = MeetingViewsOptions.NO_BUTTON_SHARE;
    // opts.no_meeting_error_message = true;
    // opts.participant_id = "participant id";

    // Step 5: Setup join meeting parameters
    JoinMeetingParams params = new JoinMeetingParams();

    params.displayName = "Hello World From Zoom SDK";
    params.meetingNo = meetingNo;

    // Step 6: Call meeting service to join meeting
    meetingService.joinMeetingWithParams(this, params, opts);
}

```

}

What am I missing?

Thank you.

---

<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:** [June 15, 2019, 12:00am UTC](https://devforum.zoom.us/t/cannot-resolve-method-zoomsdk-initialize-this-app-key-app-secret-web-domain-this/4608/4 "2019-06-15T00:00:29Z")

</div>

Hi Tobiak,

Thanks for the code. I just find out that your issue can be resolved by `implements ZoomSDKInitializeListener` in your class:

```auto
class MeetingJoin extends Activity implements ZoomSDKInitializeListener {
...
}

```

And you can still implement like the way you did in your screenshot:

```auto
if(savedInstanceState == null) {
 zoomSDK.initialize(this, APP_KEY, APP_SECRET, WEB_DOMAIN, this);
}

```

You can find the doc here:[https://marketplace.zoom.us/docs/sdk/native-sdks/android/mastering-zoom-sdk/sdk-initialization#1-initialize-the-zoom-sdk](https://marketplace.zoom.us/docs/sdk/native-sdks/android/mastering-zoom-sdk/sdk-initialization#1-initialize-the-zoom-sdk)

Hope this helps. Thanks!

---

<div class="post-metadata">

**Author:** ![Tobiak](https://avatars.discourse-cdn.com/v4/letter/t/a3d4f5/32.png) [@Tobiak](https://devforum.zoom.us/u/Tobiak)\
**Post date:** [June 15, 2019, 10:08am UTC](https://devforum.zoom.us/t/cannot-resolve-method-zoomsdk-initialize-this-app-key-app-secret-web-domain-this/4608/5 "2019-06-15T10:08:34Z")

</div>

> [@carson.zoom](#):
>
> if(savedInstanceState == null) { zoomSDK.initialize(this, APP\_KEY, APP\_SECRET, WEB\_DOMAIN, this); }

This works, did the above and added;

```auto
@Override
public void onZoomSDKInitializeResult(int errorCode, int internalErrorCode) {
  ...
}

```

In later part of my code.

Thank you.

---

<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:** [June 17, 2019, 6:10pm UTC](https://devforum.zoom.us/t/cannot-resolve-method-zoomsdk-initialize-this-app-key-app-secret-web-domain-this/4608/6 "2019-06-17T18:10:29Z")

</div>

Hi,  
Glad to hear that the problem was resolved. Let me know if you have any other questions. 🙂

Happy Zooming!

---

<div class="post-metadata">

**Author:** ![DeveloperBot](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/developerbot/32/12632_2.png) [@DeveloperBot](https://devforum.zoom.us/u/DeveloperBot)\
**Post date:** [August 21, 2020, 6:29pm UTC](https://devforum.zoom.us/t/cannot-resolve-method-zoomsdk-initialize-this-app-key-app-secret-web-domain-this/4608/7 "2020-08-21T18:29:15Z")

</div>

Closed on August 21, 2020, 6:29pm UTC


