From 65a8091e53f3ecc76a4d48b24eb8771a5f645d3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Fri, 6 Mar 2020 15:56:26 +0100 Subject: [PATCH] android: simplify code - No need to handle the activity result in the fragment, since we already do in the Activity - Automagically ddispose the view when destroyed --- .../org/jitsi/meet/sdk/JitsiMeetFragment.java | 16 ---------------- .../java/org/jitsi/meet/sdk/JitsiMeetView.java | 6 ++++++ 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/android/sdk/src/main/java/org/jitsi/meet/sdk/JitsiMeetFragment.java b/android/sdk/src/main/java/org/jitsi/meet/sdk/JitsiMeetFragment.java index d269303d0..a8afdff86 100644 --- a/android/sdk/src/main/java/org/jitsi/meet/sdk/JitsiMeetFragment.java +++ b/android/sdk/src/main/java/org/jitsi/meet/sdk/JitsiMeetFragment.java @@ -57,22 +57,6 @@ public class JitsiMeetFragment extends Fragment { return view; } - @Override - public void onActivityResult(int requestCode, int resultCode, Intent data) { - JitsiMeetActivityDelegate.onActivityResult( - getActivity(), requestCode, resultCode, data); - } - - @Override - public void onDestroyView() { - if (view != null) { - view.dispose(); - view = null; - } - - super.onDestroyView(); - } - @Override public void onDestroy() { super.onDestroy(); diff --git a/android/sdk/src/main/java/org/jitsi/meet/sdk/JitsiMeetView.java b/android/sdk/src/main/java/org/jitsi/meet/sdk/JitsiMeetView.java index 08ee20726..9c1bb2bd0 100644 --- a/android/sdk/src/main/java/org/jitsi/meet/sdk/JitsiMeetView.java +++ b/android/sdk/src/main/java/org/jitsi/meet/sdk/JitsiMeetView.java @@ -201,4 +201,10 @@ public class JitsiMeetView extends BaseReactView protected void onExternalAPIEvent(String name, ReadableMap data) { onExternalAPIEvent(LISTENER_METHODS, name, data); } + + @Override + protected void onDetachedFromWindow() { + dispose(); + super.onDetachedFromWindow(); + } }