【问题标题】:Android Webview not showing Tron explorer URLAndroid Webview 不显示 Tron 资源管理器 URL
【发布时间】:2019-05-29 14:44:31
【问题描述】:

我尝试在下面使用 android WebView 显示此 url,但在 WebViewClient 回调 onReceivedError 中未收到任何错误。但是看起来js文件有问题,写了下面的日志。如何解决此问题或在应用程序中显示此网址?

I/chromium: [INFO:CONSOLE(1)] "Uncaught TypeError: Cannot read property 'theme' of null",来源:https://tronscan.org/static/js/vendors.9044c224.js (1)

       <WebView android:id="@+id/webview"
          android:layout_width="match_parent"
          android:layout_height="match_parent"/>

       @BindView(R.id.webview) WebView eWebview;

        eWebview.setWebChromeClient(new WebChromeClient() {
            public void onProgressChanged(WebView view, int progress) {
                if(progress == 100 && !isLoaded) {
                    Log.i(TAG, "Progress:"+progress);
                    isLoaded = true;
                }
            }
        });
        eWebview.setWebViewClient(new WebViewClient() {
            public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
                Toast.makeText(activity, "Oh no! " + description, Toast.LENGTH_SHORT).show();
            }
        });

        WebSettings webSettings = eWebview.getSettings();
        webSettings.setJavaScriptEnabled(true);

        eWebview.loadUrl("https://tronscan.org/#/transaction/e760f270b2f44658019f4a24ebc1b797f3adb1e6f6725a80475d5c96f0d6bc83");

【问题讨论】:

    标签: android webview


    【解决方案1】:

    你可以试试

    webSettings.setDomStorageEnabled(true);

    来源Android Webview: "Uncaught TypeError: Cannot read property 'getItem' of null"

    【讨论】:

      猜你喜欢
      • 2023-03-13
      • 1970-01-01
      • 2021-06-17
      • 2021-07-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-06-02
      相关资源
      最近更新 更多