webview

Returning value from Javascript *reliably* to Webview

北慕城南 提交于 2021-02-19 08:38:17
问题 There is a way to call javascript function from webview and then let it call a method in Java to return the result. Like described in How to get return value from javascript in webview of android? Now, the javascript function can fail (say due to a typo in javascript file). In that case, I would like to carry out some failover code in Java. What is a good way to do that? My current code looks like this: In Java: private boolean eventHandled = false; @Override public void onEvent() {

Camera and video control with HTML5 form android webview

左心房为你撑大大i 提交于 2021-02-19 08:37:05
问题 I use this guide : Camera and video control with HTML5 This example work excellent on Google Chrome but i can not make it work on Android webview. I also use permission : android.permission.CAMERA. 回答1: Did you remember to add this to your onCreate WebSettings webSettings = myWebView.getSettings(); webSettings.setJavaScriptEnabled(true); webSettings.setAllowFileAccessFromFileURLs(true); webSettings.setAllowUniversalAccessFromFileURLs(true); You are probably missing the last two lines in your

<Input type=“file”> not working in my WebView

…衆ロ難τιáo~ 提交于 2021-02-19 08:21:53
问题 I develop Fragment WebView Application. I use upload code in Fragment WebView. When I click <input type="file"> it is active nothing. logcat show only this warning 05-22 15:59:39.749 31611-31611/kr.nubiz.comn W/cr_Ime: updateState: type [0->0], flags [0], show [false], How can I solve this problem? WebView - Fragment private void initLayout() { handler = new Handler(); webView = (android.webkit.WebView) rootView.findViewById(R.id.webview); webView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);

How to show No Internet connection dialog in webview | Android Studio

天大地大妈咪最大 提交于 2021-02-19 06:09:52
问题 I'm trying to add a message in a web view, the message should come out when you do not have an Internet connection. I have tried many ways but I always make a mistake that I do not understand. I create a folder called "assets" and add a file "error.html" following a YouTube tutorial but it gives me errors I will write my codes here without what I saw on YouTube. Thank you MainActivity.java import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.support

How to show No Internet connection dialog in webview | Android Studio

落花浮王杯 提交于 2021-02-19 06:03:06
问题 I'm trying to add a message in a web view, the message should come out when you do not have an Internet connection. I have tried many ways but I always make a mistake that I do not understand. I create a folder called "assets" and add a file "error.html" following a YouTube tutorial but it gives me errors I will write my codes here without what I saw on YouTube. Thank you MainActivity.java import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.support

Difference between innerhtml and outerhtml in cocoa WebView

时间秒杀一切 提交于 2021-02-18 22:39:30
问题 I am using cocoa webview for rich text editing in my application. Just confused with innerHtml and outerHtml method avaiable in webkit. Can anyone explain what is the difference between [(DOMHTMLElement *)[[[webView mainFrame] DOMDocument] documentElement] outerHTML]; AND [(DOMHTMLElement *)[[[webView mainFrame] DOMDocument] documentElement] outerText]; 回答1: innerHTML is a property of a DOM element that represents the HTML inside the element, i.e. between the opening and closing tags. It has

Android 9 WebView (also admob ads) not loading after Chrome update

荒凉一梦 提交于 2021-02-18 21:11:58
问题 We have an application that depends heavily on web views we noticed after last week that if an android 9 user spent some time loading webviews about 10 to 30 after that webviews just show blank page and loading progress gets stock at 10% Also admobe native ads stop showing the only thing changed was chrome update to 77.0.3865.73 we tested on android 9 that has not updated to that version everything works perfectly ( chrome 74.0.3729.136) when debugging the only message I get is : E/chromium:

Android 9 WebView (also admob ads) not loading after Chrome update

人走茶凉 提交于 2021-02-18 21:10:03
问题 We have an application that depends heavily on web views we noticed after last week that if an android 9 user spent some time loading webviews about 10 to 30 after that webviews just show blank page and loading progress gets stock at 10% Also admobe native ads stop showing the only thing changed was chrome update to 77.0.3865.73 we tested on android 9 that has not updated to that version everything works perfectly ( chrome 74.0.3729.136) when debugging the only message I get is : E/chromium:

Android webview loading fail in API 21 and above

微笑、不失礼 提交于 2021-02-18 17:11:15
问题 I have an Android application that uses WebView and load a page. This application works on Android devices running API 16 or above . Android WebView Code: String URL = "https://sandbox.napas.com.vn/gateway/message"; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_web_view); webview = (WebView) findViewById(R.id.webview); webview.getSettings().setJavaScriptEnabled(true); webview.getSettings().setAllowFileAccess

Android webview loading fail in API 21 and above

|▌冷眼眸甩不掉的悲伤 提交于 2021-02-18 17:08:41
问题 I have an Android application that uses WebView and load a page. This application works on Android devices running API 16 or above . Android WebView Code: String URL = "https://sandbox.napas.com.vn/gateway/message"; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_web_view); webview = (WebView) findViewById(R.id.webview); webview.getSettings().setJavaScriptEnabled(true); webview.getSettings().setAllowFileAccess