Questions tagged [android-websettings]

Use this tag for questions regarding managing settings state for a WebView on the Android OS

142 questions
215
votes
6 answers

Clicking URLs opens default browser

I have loaded an external URL in my WebView. Now what I need is that when the user clicks on the links on the page loaded, it has to work like a normal browser and open the link in the same WebView. But it's opening the default browser and loading…
JaVadid
  • 7,107
  • 13
  • 42
  • 54
34
votes
2 answers

Websettings.SetAppCacheEnabled deprecated, what to use instead?

During an attempt to bring an older android application into the modern world, I have come across the deprecated statement of: websettings.setAppCacheEnabled(false) What is the modern Androidx alternate?
callumg46
  • 471
  • 1
  • 4
  • 10
32
votes
14 answers

Android - Programmatically check internet connection and display dialog if notConnected

I am working on a live project. and when user click on the app. the welcome screen appears(there is a webview on that screen). and if the internet is not connected then the app crashes. Basically, my problem is to check programmatically that is…
15
votes
5 answers

Webview cannot accept cookies

I'm creating a WebView based Android app that enables the user to login onto a mobile operator. When I run the app the WebView opens the website but I get a message that the WebView doesn't allow cookies. I've tried various codes that I found here…
12
votes
5 answers

How to show Certain Part of WebPage inside Webview With Fit Screen to All Devices

I Want to Show WebPage Inside WebView. Up to this it is fine. But I have WebPage (As Given Below) and I want Certain Part of it. I mean just Top Left Corner should be visible in fit to screen mode in all the devices. I'm resolving this Problem…
Bhavesh Patadiya
  • 25,740
  • 15
  • 81
  • 107
12
votes
1 answer

How to completely disable soft keyboard for all input in Android webview

I am using phonegap to develop a web app for Android, and since I will have my own keypad in HTML, I need to disable android's system keyboard, preventing the it from showing up when the user clicks on any text input field. I don't want to use…
kli
  • 283
  • 1
  • 5
  • 16
7
votes
3 answers

Android WebView - scrollbar don't fill the layout_height

I have a WebView with large text content. I'm using the following WebView settings: settings.setJavaScriptEnabled(true); settings.setLoadWithOverviewMode(true); settings.setUseWideViewPort(true); settings.setSupportZoom(false); …
6
votes
0 answers

Android Studio getting deprecated warning even with @SuppressWarnings("deprecation")

In Android Studio, we are getting a deprecated warning during the build. This code is in onCreate(Bundle) of an Activity String databasePath = webView.getContext().getDir("databases",…
6
votes
1 answer

Log DEV_ACTION_COMPLETED seems to delay execution on Android

I've recently noticed that my app has the occasional LAG. and by LAG I mean it can take up to 40 seconds, depends if I use Wifi or mobile data... I load a page url, and then load js for execution: webView = (WebView)…
4
votes
2 answers

Android WebView not showing header bars or floating buttons

I have an Android WebView where I want to show a page, but certain elements of the page are not showing up. Since its a work related page and you need an account to access it but its hosted in Microsoft Sharepoint. On picture 1 (left) is my WebView…
Richard
  • 1,087
  • 18
  • 52
4
votes
1 answer

WebSetting allowFileAccessFromFileURLs is Deprecated in API Level 30

I wanted to use webSetting allowFileAccessFromFileURLs in WebView but the setter is deprecated. how should I set this parameter.
Yoshimitsu
  • 4,343
  • 2
  • 22
  • 28
4
votes
0 answers

Android Webview Disable Form input Zoom

I've been having issues trying to get webview from stop zooming in when a user clicks a input field on webview. How can I keep webview from stop zooming in? Heres my code: wv = (WebView) findViewById(R.id.webView1); WebSettings webSettings =…
user2423476
  • 2,115
  • 8
  • 28
  • 40
4
votes
2 answers

How to set cookie in Android WebView

I am facing issues with setting cookie in Android WebView. I am using the following code: CookieSyncManager.createInstance(this); CookieManager cookieManager = CookieManager.getInstance(); cookieManager.removeAllCookie(); …
althaf_tvm
  • 773
  • 3
  • 15
  • 28
4
votes
1 answer

Android Webview Preloading doesn't work over Nexus

We are loading Android Webview with local HTMLs and all resources in sdcard. As HTMLs are heavy (around 1MB per page) so we are working over preloading strategy means having webview instances already loaded in memory. Over UI, we have Horizontal…
4
votes
1 answer

Phonegap/Cordova App breaks in Jelly Bean - Access-Control-Allow-Origin and setAllowUniversalAccessFromFileURLs

I've been developing* with Cordova (aka Phonegap) for Android for well over a year now and am trying to make my apps available to run in Jelly Bean, but I am getting the following error: XMLHttpRequest cannot load…
mason81
  • 1,730
  • 2
  • 18
  • 33
1
2 3
9 10