From a7e042174fc1bb1df585504b9ce716f1350e166e Mon Sep 17 00:00:00 2001 From: pengfeizhou Date: Tue, 9 Feb 2021 11:01:41 +0800 Subject: [PATCH] android:Fix cannot receive onActivityResult in plugin when call activity.startActivityForResult --- .../doric/src/main/java/pub/doric/DoricActivity.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/doric-android/doric/src/main/java/pub/doric/DoricActivity.java b/doric-android/doric/src/main/java/pub/doric/DoricActivity.java index 9611bf45..fe0aed61 100644 --- a/doric-android/doric/src/main/java/pub/doric/DoricActivity.java +++ b/doric-android/doric/src/main/java/pub/doric/DoricActivity.java @@ -15,6 +15,7 @@ */ package pub.doric; +import android.content.Intent; import android.os.Bundle; import androidx.annotation.Nullable; @@ -60,4 +61,13 @@ public class DoricActivity extends AppCompatActivity { protected String getExtra() { return getIntent().getStringExtra("extra"); } + + @Override + protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { + super.onActivityResult(requestCode, resultCode, data); + int requestIndex = requestCode >> 16; + if (requestIndex == 0 && mDoricFragment != null) { + mDoricFragment.onActivityResult(requestCode, resultCode, data); + } + } }