Reputation: 35
I have a WebView pointed to a page that is supposed to redirect to another page, but it doesn't do anything. JavaScript is enabled on the app's side.
location.href = location.origin + location.pathname + '?v=' + data;
Upvotes: 1
Views: 991
Reputation: 181
Have you set a WebViewClient? WebView's default behavior (if you have no WebViewClient
) is:
Intent
(code)about:blank
), load it in the WebView (code)loadUrl()
), load it in the WebViewYou can override this default behavior by setting a default-constructed WebViewClient
:
webView.setWebViewClient(new WebViewClient());
You can find more info on this developer guide.
Upvotes: 1