Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9b1f9ee

Browse files
authored
[share] Do not tear down channel onDetachedFromActivity. (flutter#3942)
* Remove the tearDownChannel onDetachedFromActivity. Only set activity to null. * update changelog * increase version
1 parent 77cd1fc commit 9b1f9ee

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

packages/share/CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 2.0.3
2+
3+
* Do not tear down method channel onDetachedFromActivity.
4+
15
## 2.0.2
26

37
* Migrate maven repository from jcenter to mavenCentral.

packages/share/android/src/main/java/io/flutter/plugins/share/SharePlugin.java

+1-6
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public void onAttachedToActivity(ActivityPluginBinding binding) {
4545

4646
@Override
4747
public void onDetachedFromActivity() {
48-
tearDownChannel();
48+
share.setActivity(null);
4949
}
5050

5151
@Override
@@ -64,9 +64,4 @@ private void setUpChannel(Context context, Activity activity, BinaryMessenger me
6464
handler = new MethodCallHandler(share);
6565
methodChannel.setMethodCallHandler(handler);
6666
}
67-
68-
private void tearDownChannel() {
69-
share.setActivity(null);
70-
methodChannel.setMethodCallHandler(null);
71-
}
7267
}

packages/share/pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: share
22
description: Flutter plugin for sharing content via the platform share UI, using
33
the ACTION_SEND intent on Android and UIActivityViewController on iOS.
44
homepage: https://github.com/flutter/plugins/tree/master/packages/share
5-
version: 2.0.2
5+
version: 2.0.3
66

77
flutter:
88
plugin:

0 commit comments

Comments
 (0)