Переглянути джерело

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
master
Jake Breen 4 роки тому
джерело
коміт
f3c1b8ac08
Аккаунт користувача з таким Email не знайдено

+ 4
- 0
android/sdk/src/main/java/org/jitsi/meet/sdk/JitsiMeetActivity.java Переглянути файл

32
 import org.jitsi.meet.sdk.log.JitsiMeetLogger;
32
 import org.jitsi.meet.sdk.log.JitsiMeetLogger;
33
 
33
 
34
 import java.util.HashMap;
34
 import java.util.HashMap;
35
+import android.app.Activity;
35
 
36
 
36
 /**
37
 /**
37
  * A base activity for SDK users to embed. It uses {@link JitsiMeetFragment} to do the heavy
38
  * A base activity for SDK users to embed. It uses {@link JitsiMeetFragment} to do the heavy
58
         Intent intent = new Intent(context, JitsiMeetActivity.class);
59
         Intent intent = new Intent(context, JitsiMeetActivity.class);
59
         intent.setAction(ACTION_JITSI_MEET_CONFERENCE);
60
         intent.setAction(ACTION_JITSI_MEET_CONFERENCE);
60
         intent.putExtra(JITSI_MEET_CONFERENCE_OPTIONS, options);
61
         intent.putExtra(JITSI_MEET_CONFERENCE_OPTIONS, options);
62
+        if (!(context instanceof Activity)) {
63
+            intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
64
+        }
61
         context.startActivity(intent);
65
         context.startActivity(intent);
62
     }
66
     }
63
 
67
 

Завантаження…
Відмінити
Зберегти