Anuj Sharma
- Forum posts: 1
Oct 26, 2017, 12:36:29 PM via Website
Oct 26, 2017 12:36:29 PM via Website
I have a web application running on an AWS and an Android app which is just a WebView to just reflect the web application.
I had the setAppCacheEnabled set to True earlier, but I commented that piece of code in the recent version of the application.
Anytime an update is made to the web page contents, the change does not reflect on the Android WebView.
Below is a snippet of the code:
setContentView(R.layout.activity_main);
myWebView = (WebView)findViewById(R.id.webView);
WebSettings webSettings = myWebView.getSettings();
webSettings.setJavaScriptEnabled(true);
//improve webView performance
myWebView.getSettings().setRenderPriority(WebSettings.RenderPriority.HIGH);
myWebView.getSettings().setCacheMode(WebSettings.LOAD_CACHE_ELSE_NETWORK);
//myWebView.getSettings().setAppCacheEnabled(true);
myWebView.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
webSettings.setDomStorageEnabled(true);
webSettings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS);
webSettings.setUseWideViewPort(true);
webSettings.setSaveFormData(true);
webSettings.setSavePassword(true);
webSettings.setEnableSmoothTransition(true);
myWebView.loadUrl(<my web application URL>
myWebView.setWebViewClient(new WebViewClient());
Recommended editorial content
With your consent, external content is loaded here.
By clicking on the button above, you agree that external content may be displayed to you. Personal data may be transmitted to third-party providers in the process. You can find more information about this in our Privacy Policy.