fix(android) apply flags when launching activity from non-activity context
Check whether context is that of an Activity before launching the Jitsi Conference Activity. If context is not an activity context, apply flag FLAG_ACTIVITY_NEW_TASK to the Jitsi Activity Intent to ensure activity can launch without error. This scenario would manifest when a user attempts to launch the Jitsi Actvity from a Widget... for example. https://developer.android.com/about/versions/pie/android-9.0-changes-all#fant-required
This commit is contained in:
parent
f225ce886f
commit
f3c1b8ac08
|
@ -32,6 +32,7 @@ import com.facebook.react.modules.core.PermissionListener;
|
|||
import org.jitsi.meet.sdk.log.JitsiMeetLogger;
|
||||
|
||||
import java.util.HashMap;
|
||||
import android.app.Activity;
|
||||
|
||||
/**
|
||||
* A base activity for SDK users to embed. It uses {@link JitsiMeetFragment} to do the heavy
|
||||
|
@ -58,6 +59,9 @@ public class JitsiMeetActivity extends FragmentActivity
|
|||
Intent intent = new Intent(context, JitsiMeetActivity.class);
|
||||
intent.setAction(ACTION_JITSI_MEET_CONFERENCE);
|
||||
intent.putExtra(JITSI_MEET_CONFERENCE_OPTIONS, options);
|
||||
if (!(context instanceof Activity)) {
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
}
|
||||
context.startActivity(intent);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue