Android Webview:“未捕获的TypeError:无法读取null的属性'getItem'”


77

我正在创建一个简单的android应用,该应用具有应显示网址的webview。当我将网址指定为google.com或facebook.com时,它会正确加载,但是当我提供我的网址(qbo.intuit.com)时,它将不会加载并显示“ Uncaught TypeError:无法读取属性'getItem'为null ”错误。我在这里很好地粘贴了我的代码。我正在使用Compile sdk版本:API 22:Android 5.1(Lollipop),版本-Android Studio 1.4,内部版本号:AI-141.2288178,Android SDK工具:24.4.0,jdk1.7.0_80。存在类似的问题,但没有帮助我。请帮助我是Android新手。MainActivity.java

 @Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    String url= "https://qbo.intuit.com/";
    WebView view= (WebView) this.findViewById(R.id.webView);

     final WebViewClient client = new WebViewClient() {

        @Override
        public boolean shouldOverrideUrlLoading(WebView view, String url) {
            view.loadUrl(url);
            return false;
        }

    };

        WebSettings settings = view.getSettings();
        settings.setJavaScriptEnabled(true);
    view.setWebViewClient(client);
        view.loadUrl(url);


}

AndriodManifest.xml

<?xml version="1.0" encoding="utf-8"?>

<uses-permission android:name="android.permission.INTERNET"/>

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name=".MainActivity"
        android:label="@string/app_name">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>

Answers:


By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.