File tree 1 file changed +9
-3
lines changed
pythonforandroid/bootstraps/webview/build/src/main/java/org/kivy/android 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 34
34
35
35
import android .webkit .WebViewClient ;
36
36
import android .webkit .WebView ;
37
+ import android .webkit .CookieManager ;
37
38
import android .net .Uri ;
38
39
39
40
import org .renpy .android .ResourceManager ;
@@ -165,16 +166,21 @@ public void onClick(DialogInterface dialog,int id) {
165
166
mWebView .setWebViewClient (new WebViewClient () {
166
167
@ Override
167
168
public boolean shouldOverrideUrlLoading (WebView view , String url ) {
169
+ Uri u = Uri .parse (url );
168
170
if (mOpenExternalLinksInBrowser ) {
169
- if (!(url . startsWith ( "file: " ) || url . startsWith ( "http:// 127.0.0.1: " ))) {
170
- Intent i = new Intent (Intent .ACTION_VIEW , Uri . parse ( url ) );
171
+ if (!(u . getScheme (). equals ( "file" ) || u . getHost (). equals ( " 127.0.0.1" ))) {
172
+ Intent i = new Intent (Intent .ACTION_VIEW , u );
171
173
startActivity (i );
172
174
return true ;
173
175
}
174
176
}
175
- view .loadUrl (url );
176
177
return false ;
177
178
}
179
+
180
+ @ Override
181
+ public void onPageFinished (WebView view , String url ) {
182
+ CookieManager .getInstance ().flush ();
183
+ }
178
184
});
179
185
mLayout = new AbsoluteLayout (PythonActivity .mActivity );
180
186
mLayout .addView (mWebView );
You can’t perform that action at this time.
0 commit comments