java - WebView In Kitkat (4.4) Opens In a New Broswer Window -
Before I upgraded to 4.3 Android 4.4 Android tablet, I successfully loaded the web view to login with Google To indicate a user (Using OAuth 2.0) and whenever they click on the login button, they were redirected from the Allow Access window from where they were allowed or rejected Could click on All these did not happen without opening a new browser window
Upgrading, when I load the webview, this is what I see (which is still fine).
Consent instead of a user After redirecting to the screen, after entering their credentials, they see this new web browser (chrome) window:
As you can see, this is a regular browser window, as opposed to the first!
The interesting thing here is that it works fine in 4.3, but in 4.4 it is not! Anyone have any suggestions on how to fix this issue?
Thank you in advance!
edit some code
public class MyWebViewClient extends WebViewClient {@Override Public Boolean shouldOverrideUrlLoading (WebView to see, string URL) {if (Uri.parse .getHost () endsWith ("tumblr.com").) {Return false; } If (URI.PRSE (URL) .getHost () ends up ("facebook.com")) {return false; } If (Uri.Pars (URL) .getHost () ends. ("Fake.com")) {return false; } If (URI.PRSE (URL) .getHost () ends up ("google.com")) {return false; } If (URI.PRSE (URL) .getHost (). ("File") with start (return false); Intent Intent = New Intent (Int. Action_ VIEW, Uri. PRSE (URL)); . View.getContext () startActivity; Back true; } @Override Public Zero onPageStarted (WebView View, String URL, Bitmap Bitmap) {super.onPageStarted (see, url, tap); If (url.startsWith ("https://accounts.google.com/ServiceLogin")) {view.setInitialScale (100); }}}
Comments
Post a Comment