diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e9922fb..c47f1132 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 8.1.6 +### Android +Fix [#1643](https://github.com/miguelpruivo/flutter_file_picker/issues/1643) + ## 8.1.5 ### Android Fix [#872](https://github.com/miguelpruivo/flutter_file_picker/issues/872) diff --git a/android/src/main/java/com/mr/flutter/plugin/filepicker/FilePickerPlugin.java b/android/src/main/java/com/mr/flutter/plugin/filepicker/FilePickerPlugin.java index 33ec788e..8444b841 100644 --- a/android/src/main/java/com/mr/flutter/plugin/filepicker/FilePickerPlugin.java +++ b/android/src/main/java/com/mr/flutter/plugin/filepicker/FilePickerPlugin.java @@ -254,16 +254,11 @@ public void onCancel(final Object arguments) { }); this.observer = new LifeCycleObserver(activity); - if (registrar != null) { - // V1 embedding setup for activity listeners. - application.registerActivityLifecycleCallbacks(this.observer); - registrar.addActivityResultListener(this.delegate); - } else { - // V2 embedding setup for activity listeners. - activityBinding.addActivityResultListener(this.delegate); - this.lifecycle = FlutterLifecycleAdapter.getActivityLifecycle(activityBinding); - this.lifecycle.addObserver(this.observer); - } + // V2 embedding setup for activity listeners. + activityBinding.addActivityResultListener(this.delegate); + this.lifecycle = FlutterLifecycleAdapter.getActivityLifecycle(activityBinding); + this.lifecycle.addObserver(this.observer); + } private void tearDown() { diff --git a/pubspec.yaml b/pubspec.yaml index d5bf21dd..f2da922b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -3,7 +3,7 @@ description: A package that allows you to use a native file explorer to pick sin homepage: https://github.com/miguelpruivo/plugins_flutter_file_picker repository: https://github.com/miguelpruivo/flutter_file_picker issue_tracker: https://github.com/miguelpruivo/flutter_file_picker/issues -version: 8.1.5 +version: 8.1.6 dependencies: flutter: