Browse Source

fix Android close

Lejard Hadrien 8 years ago
parent
commit
2a5cf0ea0d

+ 4 - 0
CHANGELOG.md

@@ -1,5 +1,9 @@
 # 0.1.0
 # 0.1.0
 
 
+- fix Android close webview
+
+# 0.1.0
+
 - iOS && Android:
 - iOS && Android:
     - get cookies
     - get cookies
     - eval javascript
     - eval javascript

+ 1 - 1
android/src/main/java/com/flutter_webview_plugin/WebviewManager.java

@@ -69,7 +69,7 @@ class WebviewManager {
     }
     }
 
 
     void close(MethodCall call, MethodChannel.Result result) {
     void close(MethodCall call, MethodChannel.Result result) {
-        if (View.VISIBLE == webView.getVisibility()) {
+        if (webView != null) {
             ViewGroup vg = (ViewGroup) (webView.getParent());
             ViewGroup vg = (ViewGroup) (webView.getParent());
             vg.removeView(webView);
             vg.removeView(webView);
         }
         }

+ 1 - 1
pubspec.yaml

@@ -5,7 +5,7 @@ authors:
 - Toufik Zitouni <toufiksapps@gmail.com>
 - Toufik Zitouni <toufiksapps@gmail.com>
 - Pedia <kpedia@163.com>
 - Pedia <kpedia@163.com>
 homepage: https://github.com/dart-flitter/flutter_webview_plugin
 homepage: https://github.com/dart-flitter/flutter_webview_plugin
-version: 0.1.0
+version: 0.1.0+1
 
 
 flutter:
 flutter:
   plugin:
   plugin: