Browse Source

android: throw if Activity doesn't implement the required interface

j8
Saúl Ibarra Corretgé 7 years ago
parent
commit
0c3d037cb5
1 changed files with 6 additions and 0 deletions
  1. 6
    0
      android/sdk/src/main/java/org/jitsi/meet/sdk/JitsiMeetView.java

+ 6
- 0
android/sdk/src/main/java/org/jitsi/meet/sdk/JitsiMeetView.java View File

@@ -109,6 +109,12 @@ public class JitsiMeetView
109 109
         // The entry point into the invite feature of Jitsi Meet. The Java
110 110
         // counterpart of the JavaScript InviteButton.
111 111
         inviteController = new InviteController(externalAPIScope);
112
+
113
+        // Check if the parent Activity implements JitsiMeetActivityInterface,
114
+        // otherwise things may go wrong.
115
+        if (!(context instanceof JitsiMeetActivityInterface)) {
116
+            throw new RuntimeException("Enclosing Activity must implement JitsiMeetActivityInterface");
117
+        }
112 118
     }
113 119
 
114 120
     /**

Loading…
Cancel
Save