How to fix Blankwebview in Android studio


I just made a simple webview and it works perfectly fine when I use the URL as but when I put my own URL it doesn’t show up on the app instead it said you needed JavaScript to run this app. I enabled Java script and now there is nothing shown in the app. Here’s my code:

package com.------;


import android.os.Bundle;
import android.webkit.WebChromeClient;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;

public class MainActivity extends AppCompatActivity {

    private WebView Browser;
    protected void onCreate(Bundle savedInstanceState) {

        Browser  (WebView) findViewById(;
        Browser.setWebViewClient(new WebViewClient());

        WebSettings webSettings1  Browser.getSettings();


and manifest:

<?xml version"1.0" encoding"utf-8"?>
<manifest xmlns:android""

    <uses-permission android:name"android.permission.INTERNET"/>
    <uses-permission android:name"android.permission.ACCESS_NETWORK_STATE"/>
    <uses-permission android:name"android.permission.ACCESS_WIFI_STATE"/>
        <activity android:name".MainActivity">
                <action android:name"android.intent.action.MAIN" />

                <category android:name"android.intent.category.LAUNCHER" />


nd the error:

38:36.242 10536-10536/? E/------: Unknown bits set in runtime_flags: 0x8000
2020-09-11 22:38:36.777 10536-10572/com---------- E/ion: ioctl c0044901 failed with code -1: Invalid argument


your code is fine as i can see and you said that (it works perfectly fine when I use the URL as that tell you the problem is in your web site not in the web view it’s look like your website need a java script and i think you have to use a browser java script engine not web view engine chrome java script engine as example

to use chrome java script engine you can use Chrome Custom Tabs to open an chrome tab on your app Chrome Custom Tabs allow an app to customize how Chrome looks and feels. An app can change things like:

Toolbar color Enter and exit animations Add custom actions to the Chrome toolbar, overflow menu and bottom toolbar The WebView is good solution if you are hosting your own content inside your app. If your app directs people to URLs outside your domain, i recommend that you use Chrome Custom Tabs A complete example is available at It contains re-usable classes to customize the UI,

Answered By – Sideeg MoHammed

Leave a Comment