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

**URL:** <https://devforum.zoom.us/t/extended-by-meetingactivity-is-causing-app-crash-and-unable-to-restrict-mobile-app-screen-capture/64880>\
**Category:** Android\
**Created:** [February 25, 2022, 10:09am UTC](https://devforum.zoom.us/t/extended-by-meetingactivity-is-causing-app-crash-and-unable-to-restrict-mobile-app-screen-capture/64880 "2022-02-25T10:09:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![naveen.kumar.nuveda](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/naveen.kumar.nuveda/32/35249_2.png) [@naveen.kumar.nuveda](https://devforum.zoom.us/u/naveen.kumar.nuveda)\
**Post date:** [February 25, 2022, 10:09am UTC](https://devforum.zoom.us/t/extended-by-meetingactivity-is-causing-app-crash-and-unable-to-restrict-mobile-app-screen-capture/64880/1 "2022-02-25T10:09:32Z")

</div>

**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](https://devforum.zoom.us/t/how-to-disable-screen-recorder-and-screen-shoret-in-zoom-sdk/5851)

**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

```auto
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

```auto
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)

---

<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:** [February 25, 2022, 8:11pm UTC](https://devforum.zoom.us/t/extended-by-meetingactivity-is-causing-app-crash-and-unable-to-restrict-mobile-app-screen-capture/64880/2 "2022-02-25T20:11:36Z")

</div>

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](https://marketplace.zoom.us/docs/sdk/native-sdks/android/mastering-zoom-sdk/in-meeting-function/customized-meeting-ui/overview).

Thanks!

---

<div class="post-metadata">

**Author:** ![naveen.kumar.nuveda](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/naveen.kumar.nuveda/32/35249_2.png) [@naveen.kumar.nuveda](https://devforum.zoom.us/u/naveen.kumar.nuveda)\
**Post date:** [February 28, 2022, 6:30am UTC](https://devforum.zoom.us/t/extended-by-meetingactivity-is-causing-app-crash-and-unable-to-restrict-mobile-app-screen-capture/64880/3 "2022-02-28T06:30:43Z")

</div>

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

---

<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:** [February 28, 2022, 7:14pm UTC](https://devforum.zoom.us/t/extended-by-meetingactivity-is-causing-app-crash-and-unable-to-restrict-mobile-app-screen-capture/64880/4 "2022-02-28T19:14:33Z")

</div>

You are welcome, glad I could help!

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

---

<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:** [February 28, 2022, 7:14pm UTC](https://devforum.zoom.us/t/extended-by-meetingactivity-is-causing-app-crash-and-unable-to-restrict-mobile-app-screen-capture/64880/5 "2022-02-28T19:14:36Z")

</div>

Closed on February 28, 2022, 7:14pm UTC


