Fix crash on older android

Stephen Paul Weber created

Might make the behaviour slightly wrong, but better than a crash

Change summary

src/main/java/eu/siacs/conversations/ui/XmppActivity.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

Detailed changes

src/main/java/eu/siacs/conversations/ui/XmppActivity.java 🔗

@@ -120,7 +120,8 @@ public abstract class XmppActivity extends ActionBarActivity {
     protected Toast mToast;
     public Runnable onOpenPGPKeyPublished = () -> Toast.makeText(XmppActivity.this, R.string.openpgp_has_been_published, Toast.LENGTH_SHORT).show();
     protected ConferenceInvite mPendingConferenceInvite = null;
-    protected PriorityQueue<Pair<Integer, ValueCallback<Uri[]>>> activityCallbacks = new PriorityQueue<>((x, y) -> y.first.compareTo(x.first));
+    protected PriorityQueue<Pair<Integer, ValueCallback<Uri[]>>> activityCallbacks =
+        Build.VERSION.SDK_INT >= 24 ? new PriorityQueue<>((x, y) -> y.first.compareTo(x.first)) : new PriorityQueue<>();
     protected ServiceConnection mConnection = new ServiceConnection() {
 
         @Override