Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid WebView turned black when filling out a form
    primarykey
    data
    text
    <p>I encounter this problem when filling out a form loaded by my app using android webview:</p> <p><a href="https://lh6.googleusercontent.com/-lik5GC5CcIU/T0W5n9dJeTI/AAAAAAAABrM/JIlqB5_Tq9Q/s1130/webview-blackout-problem.jpg" rel="nofollow">https://lh6.googleusercontent.com/-lik5GC5CcIU/T0W5n9dJeTI/AAAAAAAABrM/JIlqB5_Tq9Q/s1130/webview-blackout-problem.jpg</a></p> <p>Sorry, I can't directly post the image because I'm new here so StackOverflow won't allow me.</p> <p>As you can see, some part of the screen turned black when I tried to fill out a text field. Thanks for any help!</p> <p>Code I use:</p> <pre><code>package com.example.WebViewer; import android.app.Activity; import android.os.Bundle; import android.os.Environment; import android.util.Log; import android.view.Window; import android.webkit.WebChromeClient; import android.webkit.WebView; import android.webkit.WebViewClient; import android.widget.Toast; public class WebViewerActivity extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); //setContentView(R.layout.main); // Let's display the progress in the activity title bar, like the // browser app does. getWindow().requestFeature(Window.FEATURE_PROGRESS); WebView webview = new WebView(this); setContentView(webview); webview.getSettings().setJavaScriptEnabled(true); final Activity activity = this; webview.setWebChromeClient(new WebChromeClient() { public void onProgressChanged(WebView view, int progress) { // Activities and WebViews measure progress with different scales. // The progress meter will automatically disappear when we reach 100% activity.setProgress(progress * 1000); } }); webview.setWebViewClient(new WebViewClient() { public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { //Users will be notified in case there's an error (i.e. no internet connection) Toast.makeText(activity, "Oh no! " + description, Toast.LENGTH_SHORT).show(); } }); //This will load the webpage that we want to see String url = "file:///" + Environment.getExternalStorageDirectory() + "/SomeFiles/Downloads/SalesOrderForms/4_2.html"; webview.loadUrl(url); Log.e("URL", url); } } </code></pre> <p>I also use jQuery on that page. I tried to removed it but I got the same results.</p> <p>I tried viewing it in HTML viewer but instead of black, some parts of the screen turned white.</p> <p>I tried viewing it in the device browser and it seemed ok.</p> <p>I'm using 10.1 inch samsung galaxy tab. with android 3.0 os</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload