Przeglądaj źródła

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
j8
Jake Breen 4 lat temu
rodzic
commit
f3c1b8ac08
No account linked to committer's email address

+ 4
- 0
android/sdk/src/main/java/org/jitsi/meet/sdk/JitsiMeetActivity.java Wyświetl plik

@@ -32,6 +32,7 @@ import com.facebook.react.modules.core.PermissionListener;
32 32
 import org.jitsi.meet.sdk.log.JitsiMeetLogger;
33 33
 
34 34
 import java.util.HashMap;
35
+import android.app.Activity;
35 36
 
36 37
 /**
37 38
  * 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
58 59
         Intent intent = new Intent(context, JitsiMeetActivity.class);
59 60
         intent.setAction(ACTION_JITSI_MEET_CONFERENCE);
60 61
         intent.putExtra(JITSI_MEET_CONFERENCE_OPTIONS, options);
62
+        if (!(context instanceof Activity)) {
63
+            intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
64
+        }
61 65
         context.startActivity(intent);
62 66
     }
63 67
 

Ładowanie…
Anuluj
Zapisz