Return To Meeting button

Description
How to add a “Return to Meeting” button?
I used this method in the onCreate() method, but it is giving a NullPointerException.

public void inMeetingButton(){
        initializeSdk(this);
        MeetingStatus status;
        status = ZoomSDK.getInstance().getMeetingService().getMeetingStatus();
        if(status == MeetingStatus.MEETING_STATUS_INMEETING || status == MeetingStatus.MEETING_STATUS_IN_WAITING_ROOM ||                status == MeetingStatus.MEETING_STATUS_RECONNECTING || status == MeetingStatus.MEETING_STATUS_UNKNOWN ||
                status == MeetingStatus.MEETING_STATUS_WAITINGFORHOST ||
                status == MeetingStatus.MEETING_STATUS_CONNECTING){
            button1.setVisibility(View.INVISIBLE);
            button3.setVisibility(View.VISIBLE);
            textview1.setVisibility(View.INVISIBLE);
            edittext1.setVisibility(View.INVISIBLE);
            til1.setVisibility(View.INVISIBLE);
        } else {
            button3.setVisibility(View.INVISIBLE);
        }

button3 is the Return to Meeting button.

Which Android Client SDK version?
v5.5.1.1319

Screenshots



Smartphone (please complete the following information):

  • Device: Xiaomi Redmi Note 9
  • OS: Android 10

Hi @soumoghosh37, thanks for the post.

The error you are seeing is happening because you are trying to access the MeetingService too soon. The SDK must be successfully initialized before any of the classes provided by it are non-null. You can find more information on how to initialize the SDK here.

Thanks!

1 Like

Hi @jon.lieblich,

Actually I am initializing it twice (tried with once, did not work), first at the beginning of the onCreate() method, and then again in this method.

My iniatializeSdk():

public void initializeSdk(Context context) {

        ZoomSDK sdk = ZoomSDK.getInstance();
        ZoomSDKInitParams params = new ZoomSDKInitParams();
        params.appSecret = Credentials.SDK_SECRET;
        params.appKey = Credentials.SDK_KEY;
        params.domain = Credentials.SDK_DOMAIN;
        params.enableLog = true;

        ZoomSDKInitializeListener listener = new ZoomSDKInitializeListener() {
            @Override
            public void onZoomSDKInitializeResult(int i, int i1) {
            }

            @Override
            public void onZoomAuthIdentityExpired() { }
        };
        sdk.initialize(context, listener, params);
    } 

My onCreate():

@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        initializeSdk(this); //Zoom SDK Initialization
        ....
}

Also please check the question again, I have edited it and included the initializeSdk().

Thank you!

Hi @soumoghosh37,

Thanks for providing the code snippets. Just calling the initialize method on the SDK does not mean that it has been successfully initialized. In your ZoomSDKInitializeListener instance, you will need to receive a result with an error code of ZoomError.ZOOM_ERROR_SUCCESS. Upon receiving this, you can begin using the SDK to join or start a meeting.

Thanks!

1 Like

Hi @jon.lieblich

Can you please tell me how to do this, or maybe give a link where I can find some information about this? I am not able to understand how to get a result from the instance.

Thanks!

Hi @soumoghosh37,

Our SDK initialization documentation should provide you with all of the information you need to properly initialize the SDK. If you have any specific questions on this flow, please let me know and I will be happy to help. :slightly_smiling_face:

Thanks!

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