Bläddra i källkod

android: bring back activity to the foreground when exiting PiP

When exiting PiP with by pressing the X the onPictureInPictureModeChanged method
is called. Since onResume is called a while after, in case the maximize button
is called, it's not easy to know if the user pressed the X button, and that was
the cause for exiting PiP.

So, in order to avoid show the user they are still in the meeting, bring the
activity to the foregound so they can hangup.
master
Saúl Ibarra Corretgé 4 år sedan
förälder
incheckning
d9250aa986
1 ändrade filer med 12 tillägg och 0 borttagningar
  1. 12
    0
      android/app/src/main/java/org/jitsi/meet/MainActivity.java

+ 12
- 0
android/app/src/main/java/org/jitsi/meet/MainActivity.java Visa fil

210
         return super.onKeyUp(keyCode, event);
210
         return super.onKeyUp(keyCode, event);
211
     }
211
     }
212
 
212
 
213
+    @Override
214
+    public void onPictureInPictureModeChanged(boolean isInPictureInPictureMode) {
215
+        super.onPictureInPictureModeChanged(isInPictureInPictureMode);
216
+
217
+        Log.d(TAG, "Is in picture-in-picture mode: " + isInPictureInPictureMode);
218
+
219
+        if (!isInPictureInPictureMode) {
220
+            this.startActivity(new Intent(this, getClass())
221
+                .addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT));
222
+        }
223
+    }
224
+
213
     // Helper methods
225
     // Helper methods
214
     //
226
     //
215
 
227
 

Laddar…
Avbryt
Spara