Skip to content

Commit

Permalink
use standard Activity as calling class to support FlutterFragmentActi…
Browse files Browse the repository at this point in the history
…vity as well as the default FragmentActivity
  • Loading branch information
Jonas Bark committed Nov 5, 2017
1 parent c873ece commit d9c3c47
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 0.0.9

- Android: remove the need to use FlutterActivity as base activity

# 0.0.5

- fix "onDestroy" event for iOS [#4](https://github.com/dart-flitter/flutter_webview_plugin/issues/4)
Expand All @@ -14,4 +18,4 @@

# 0.0.2

- Initial version for Android
- Initial version for Android
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@
* FlutterWebviewPlugin
*/
public class FlutterWebviewPlugin implements MethodCallHandler {
private FlutterActivity activity;
private Activity activity;
public static MethodChannel channel;
private final int WEBVIEW_ACTIVITY_CODE = 1;
private static final String CHANNEL_NAME = "flutter_webview_plugin";

public static void registerWith(PluginRegistry.Registrar registrar) {
channel = new MethodChannel(registrar.messenger(), CHANNEL_NAME);
FlutterWebviewPlugin instance = new FlutterWebviewPlugin((FlutterActivity) registrar.activity());
FlutterWebviewPlugin instance = new FlutterWebviewPlugin((Activity) registrar.activity());
channel.setMethodCallHandler(instance);
}

private FlutterWebviewPlugin(FlutterActivity activity) {
private FlutterWebviewPlugin(Activity activity) {
this.activity = activity;
}

Expand Down Expand Up @@ -62,4 +62,3 @@ private void close(MethodCall call, MethodChannel.Result result) {
result.success(null);
}
}

2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ authors:
- Hadrien Lejard <hadrien.lejard@gmail.com>
- Toufik Zitouni <toufiksapps@gmail.com>
homepage: https://github.com/dart-flitter/flutter_webview_plugin
version: 0.0.8
version: 0.0.9

flutter:
plugin:
Expand Down

0 comments on commit d9c3c47

Please sign in to comment.