Android Question Has something changed with WebView and current Android version?

Robert Valentino

Well-Known Member
Licensed User
Longtime User
My app opens and webview and loads a url.

I have been getting reports about it just hanging trying to open the webview. (users got this on a Samsung Tablet and Chromebook)

Is there some new setting or permission I need to add now that we are using SDK 35 to get the webview to continue on to the webpage?

Thanks for any help

BobVal
 

Robert Valentino

Well-Known Member
Licensed User
Longtime User
Just realized, last year I added this code because the website I am going to LeagueSecretary
is so loaded with ADs
B4X:
'-------------------------------------------------------------------------------
'    doSettings - This fix patches WebView so that LS webpage will load
'                 Without this routine the webpage just hangs
'-------------------------------------------------------------------------------
#IF JAVA
    import android.webkit.WebView;
    import android.webkit.WebSettings;

    public void doSettings( WebView wv ) {
       wv.getSettings().setCacheMode(WebSettings.LOAD_CACHE_ELSE_NETWORK);
       wv.getSettings().setJavaScriptEnabled(true);
       wv.getSettings().setDomStorageEnabled(true);
       wv.clearClientCertPreferences( null );
       wv.clearSslPreferences();
       wv.clearHistory();
       wv.getSettings().setDisplayZoomControls(false);
       wv.getSettings().setBuiltInZoomControls(true);
       wv.getSettings().setAllowFileAccess(true);   // google turns this off by default as of api30
    }
#End If

I wonder if the problem is when you go to leaguesecretary the first thing you get to is turn off your AD Block page. Wonder if that could be hanging things
 
Upvote 0

Robert Valentino

Well-Known Member
Licensed User
Longtime User
I am attaching a little test program that when button is clicked should open up a page of instructions and when clicking on Open Web Browser should display the LeagueSecretary.com website.

This works on ALL my devices - but some users report it just hangs trying to go to the web page.

PLEASE any help
 

Attachments

  • Test_LS.zip
    71.3 KB · Views: 5
Upvote 0
Top