Extended by MeetingActivity is causing App Crash and Unable to restrict Mobile App Screen Capture

Description
I need to disable Mobile Screen capture and Mobile Screen Recording for security reason.
I did it for my app. But in zoom still able to capture the screen shot.
for this I used this link

referral link

Which Android Meeting SDK version?
5.9.3.4273

To Reproduce(If applicable)
Steps to reproduce the behavior:

  1. Create a your own activity extended by MeetingActivity
class ZoomMeetingJoinActivity : MeetingActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        window?.setFlags(WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE)

        setContentView(R.layout.activity_zoom_meeting_join)
    }

    override fun onBackPressed() {
        onClickLeave()
    }
}
  1. Add config.xml
    <string name="zm_config_conf_activity" translatable="false">com.example.testbottomnaviigation.ZoomMeetingJoinActivity</string>

  2. Call Join Meeting in MainActivity

class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        findViewById<Button>(R.id.joinMeetingBtn).setOnClickListener {
            joinZoomMeeting(this)
        }
    }

    private fun joinZoomMeeting(context: Context) {
        val sdk = ZoomSDK.getInstance()
        val params = ZoomSDKInitParams().apply {
            appKey = "Your_API_Key" // TODO: Retrieve your SDK key and enter it here
            appSecret = "Your_Secret_Key" // TODO: Retrieve your SDK secret and enter it here
            domain = "zoom.us"
            enableLog = true // Optional: enable logging for debugging
        }
        val listener = object : ZoomSDKInitializeListener {
            override fun onZoomSDKInitializeResult(errorCode: Int, internalErrorCode: Int){
                if(errorCode == ZoomError.ZOOM_ERROR_SUCCESS){


                    val meetingService = ZoomSDK.getInstance().meetingService
                    val opts = JoinMeetingOptions()
                    opts.no_driving_mode = true
                    opts.no_invite = true
                    opts.no_share = true
                    opts.invite_options = InviteOptions.INVITE_DISABLE_ALL
                    opts.meeting_views_options = MeetingViewsOptions.NO_BUTTON_SHARE + MeetingViewsOptions.NO_TEXT_PASSWORD + MeetingViewsOptions.NO_TEXT_MEETING_ID
                    opts.no_meeting_error_message = true
                    val params2 = JoinMeetingParams().apply {
                        displayName = "Test User"
                        meetingNo = "93*****"
                        password = "1*****"
                    }
                    meetingService.joinMeetingWithParams(context, params2, opts)
                }
            }
            override fun onZoomAuthIdentityExpired() = Unit
        }
        sdk.initialize(context, listener, params)
    }

}

Smartphone (please complete the following information):
All the Devices

Additional context - CrashLog
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.testbottomnaviigation/com.example.testbottomnaviigation.ZoomMeetingJoinActivity}: java.lang.NullPointerException: Attempt to invoke virtual method ‘void com.zipow.videobox.view.video.ZmBaseThumbnailRenderView.setEventListener(com.zipow.videobox.view.video.ZmBaseThumbnailRenderView$c)’ on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2778)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method ‘void com.zipow.videobox.view.video.ZmBaseThumbnailRenderView.setEventListener(com.zipow.videobox.view.video.ZmBaseThumbnailRenderView$c)’ on a null object reference
at com.zipow.videobox.conference.context.uisession.ZmMainThumbnailSession.b(ZmMainThumbnailSession.java:4)
at com.zipow.videobox.conference.context.f.b(ZmContextGroupSession.java:6)
at com.zipow.videobox.conference.context.g.b(ZmContextGroupSessionMgr.java:6)
at com.zipow.videobox.ConfActivityNormal.onStart(ConfActivityNormal.java:3)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1334)
at android.app.Activity.performStart(Activity.java:7029)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2741)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)

Hi @naveen.kumar.nuveda,

It looks like you’re trying to set an additional layout on top of the UI defined for the MeetingActivity instance by calling setContentView. If you are looking to define your own custom meeting UI, you should not extend the MeetingActivity provided by the SDK, as that is meant to be used with the default UI.

To get started with implementing your own custom meeting UI, please see our documentation.

Thanks!

Thanks Jon. It is worked.
Yeah setContentView is the problem after removing this It is working fine

You are welcome, glad I could help!

Please don’t hesitate to reach back out in a new topic with any additional questions. :slightly_smiling_face: