From 1e76d2c24988da6e5cf4466f6556bf161e744dc4 Mon Sep 17 00:00:00 2001 From: Richard Windley Date: Thu, 1 Nov 2018 14:25:36 +0000 Subject: [PATCH] Add onActivityResult support --- README.MD | 3 +++ package.json | 2 +- plugin.xml | 2 +- src/android/MainActivity.java | 6 ++++++ 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/README.MD b/README.MD index 1240113..8e6ae10 100644 --- a/README.MD +++ b/README.MD @@ -21,6 +21,9 @@ AndroidManifest.xml is automatically updated to use the new MainActivity. Based on cordova-android-fragments (https://github.com/rajivnarayana/CordovaFragments) # History +## 0.0.8 +- Add onActivityResult callback + ## 0.0.7 - Merge FrameLayout change - Merge ${mypackage} fix diff --git a/package.json b/package.json index 7633367..3630b1b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cordova-plugin-android-fragmentactivity", - "version": "0.0.7", + "version": "0.0.8", "description": "An android plugin that provides a replacement activity to the default activity to start a cordova application with MainActivity as a Fragment Activity. Useful when you want to add native views on top of cordova webview.", "cordova": { "id": "cordova-plugin-android-fragmentactivity", diff --git a/plugin.xml b/plugin.xml index 75cf0e2..067e1a7 100644 --- a/plugin.xml +++ b/plugin.xml @@ -1,5 +1,5 @@ - + Cordova Android FragmentActivity Plugin An android plugin that provides a replacement activity to the default activity to start a cordova application with MainActivity as a Fragment Activity. Useful when you want to add native views on top of cordova webview. diff --git a/src/android/MainActivity.java b/src/android/MainActivity.java index 68625cd..2e66315 100644 --- a/src/android/MainActivity.java +++ b/src/android/MainActivity.java @@ -90,6 +90,12 @@ public void onDestroy() { currentFragment.onDestroy(); } + @Override + public void onActivityResult(int requestCode, int resultCode, Intent data) { + super.onActivityResult(requestCode,resultCode,data); + currentFragment.onActivityResult(requestCode,resultCode,data); + } + @Override public void onRequestPermissionsResult(int requestCode, String permissions[], int[] grantResults) {