android:Fix cannot receive onActivityResult in plugin when call activity.startActivityForResult

This commit is contained in:
pengfeizhou 2021-02-09 11:01:41 +08:00 committed by osborn
parent 21774591ee
commit a7e042174f

View File

@ -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);
}
}
}