# Screen Share issues in meeting SDK

**URL:** <https://devforum.zoom.us/t/screen-share-issues-in-meeting-sdk/89430>\
**Category:** Android\
**Created:** [June 1, 2023, 4:54am UTC](https://devforum.zoom.us/t/screen-share-issues-in-meeting-sdk/89430 "2023-06-01T04:54:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![speechlogix](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/speechlogix/32/48720_2.png) [@speechlogix](https://devforum.zoom.us/u/speechlogix)\
**Post date:** [June 1, 2023, 4:54am UTC](https://devforum.zoom.us/t/screen-share-issues-in-meeting-sdk/89430/1 "2023-06-01T04:54:58Z")

</div>

I want to implement the same functionality of ‘share screen’ button as like that of Zoom.  
My code for that is shown below.  
share.setOnClickListener(new View.OnClickListener() {  
@Override  
public void onClick(View v) {  
AlertDialog.Builder alert = new AlertDialog.Builder(MainActivity.this);  
final EditText edittext = new EditText(MainActivity.this);  
alert.setMessage(“\nEnter sharing key or Meeting ID to share to a Zoom Room”);  
alert.setTitle(“\t\t\t\t\t\t\t\tShare Screen”);

```
    LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(
            LinearLayout.LayoutParams.MATCH_PARENT,
            LinearLayout.LayoutParams.MATCH_PARENT);
    edittext.setLayoutParams(lp);
    alert.setView(edittext);

    alert.setPositiveButton("OK", new DialogInterface.OnClickListener() {
        public void onClick(DialogInterface dialog, int whichButton) {
            //What ever you want to do with the value
         final Editable YouEditTextValue = edittext.getText();

```

// MediaProjectionManager manager = (MediaProjectionManager) getSystemService(Context.MEDIA\_PROJECTION\_SERVICE);  
// if (manager != null) {  
// Intent intent = manager.createScreenCaptureIntent();  
// startActivityForResult(intent, REQUEST\_SCREEN\_CAPTURE);  
// }  
MeetingService meetingService1 = ZoomSDK.getInstance().getMeetingService();  
JoinMeetingOptions options = new JoinMeetingOptions();  
options.no\_invite = true;  
options.no\_audio=true;  
options.no\_video=true;  
options.no\_bottom\_toolbar = true;  
options.no\_dial\_in\_via\_phone = true;  
options.no\_dial\_out\_to\_phone = true;

```
            //meetingService.addListener(meetingServiceListener);

            JoinMeetingParams params1 = new JoinMeetingParams();
            //params.displayName = "User Name";
            params1.meetingNo = String.valueOf(YouEditTextValue);
            params1.password = MeetingParams.getPassword();
            meetingService1.joinMeetingWithParams(MainActivity.this, params1, options);
            //InMeetingService inMeetingService = ZoomSDK.getInstance().getInMeetingService();
            meetingService1.addListener(new MeetingServiceListener() {

                @Override
                public void onMeetingStatusChanged(MeetingStatus meetingStatus, int i, int i1) {
                    switch (meetingStatus) {
                        case MEETING_STATUS_CONNECTING:
                            // Meeting is connecting
                            break;
                        case MEETING_STATUS_INMEETING: {
                            startMediaProjectionRequest();

                       }
                            break;
                        }
                }

                @Override
                public void onMeetingParameterNotification(MeetingParameter meetingParameter) {

                }
            });

        }
    });

    alert.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
        public void onClick(DialogInterface dialog, int whichButton) {
            // what ever you want to do with No option.
        }
    });

    alert.show();
}

```

});  
}  
private void startMediaProjectionRequest() {  
if (mScreenInfoData == null) {  
mediaProjectionManager = (MediaProjectionManager) getSystemService(Context.MEDIA\_PROJECTION\_SERVICE);  
startActivityForResult(mediaProjectionManager.createScreenCaptureIntent(), MEDIA\_PROJECTION\_REQUEST\_CODE);  
} else {  
startScreenShareService();  
}  
}

@SuppressLint(“NewApi”)  
private void startShareScreen(Intent data) {  
// Timber.e(“Start share screen %s”, data);  
mScreenInfoData = data;  
if (data == null) {  
return;  
}  
if (Build.VERSION.SDK\_INT \>= 24) {  
Intent intent = new Intent(“android.settings.action.MANAGE\_OVERLAY\_PERMISSION”, Uri.parse(“package:” + getPackageName()));  
startActivityForResult(intent, REQUEST\_SYSTEM\_ALERT\_WINDOW);  
} else {  
startScreenShareService();  
}  
}

private void startScreenShareService() {  
MobileRTCSDKError error = ZoomSDK.getInstance().getInMeetingService().getInMeetingShareController().startShareScreenSession(mScreenInfoData);

}  
@Override  
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {  
super.onActivityResult(requestCode, resultCode, data);  
{  
if (requestCode == MEDIA\_PROJECTION\_REQUEST\_CODE) {  
if (resultCode == Activity.RESULT\_OK) {  
startShareScreen(data);  
} else {  
// Timber.e(“Screen share permission denied!”);  
}  
} else if (requestCode == REQUEST\_SYSTEM\_ALERT\_WINDOW) {  
ZoomSDK.getInstance().getInMeetingService().getInMeetingShareController().startShareScreenSession(mScreenInfoData);  
}  
}  
In this code the share screen is not working. Can anyone review the code and please suggest a solution.

---

<div class="post-metadata">

**Author:** ![speechlogix](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/speechlogix/32/48720_2.png) [@speechlogix](https://devforum.zoom.us/u/speechlogix)\
**Post date:** [June 5, 2023, 5:49am UTC](https://devforum.zoom.us/t/screen-share-issues-in-meeting-sdk/89430/2 "2023-06-05T05:49:51Z")

</div>

Screen share issues are not resolved

---

<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 5, 2023, 3:50pm UTC](https://devforum.zoom.us/t/screen-share-issues-in-meeting-sdk/89430/3 "2023-07-05T15:50:46Z")

</div>

Closed on July 5, 2023, 3:50pm UTC

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