jitsi / jitsi-meet-sdk-samples

Jitsi Meet mobile SDK examples (Android, iOS and React Native)
Apache License 2.0
273 stars 238 forks source link

Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want #128

Closed aivision369 closed 2 years ago

aivision369 commented 2 years ago

I have integrated this SDK and its working fine up to Android 9 and below but when I run the app on Android 10 then getting below exception : android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want

I have done some R&D and see that I need to add this flag inteng.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) while we start the activity but activity is launching from JitsiMeet dependency so how can we add this flag? because once we add dependency in the project, we are unable to update any JitsiMeet sdk files.

@saghul Help would be appreciate and please help me.

saghul commented 2 years ago

Are you calling JitsiMeetActivity.launch() ? From where?

aivision369 commented 2 years ago

@saghul I am calling JitsiMeetActivity.launch() from my Activity class as below :

public void launchLiveCallRequest() {

        JitsiMeetConferenceOptions options
                = new JitsiMeetConferenceOptions.Builder()
                .setRoom(PrivateCallSession.getInstance().getRoomId())
                .build();
        JitsiMeetActivity.launch(MyApp.getContext(), options);
    }
saghul commented 2 years ago

Why are you passing your app's context instead of the calling activity as the first argument?

aivision369 commented 2 years ago

I have updated the latest version of JitsiMeet 4.1.0 and my error is solved. thank you.