Browse Source

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.
j8
Saúl Ibarra Corretgé 4 years ago
parent
commit
d9250aa986
1 changed files with 12 additions and 0 deletions
  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 View File

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
 

Loading…
Cancel
Save