0

I tried to show this url below with android WebView and not received any error in WebViewClient callback onReceivedError. But looks like there is something wrong in js file and the log below is written. How can i fix this or show this url inside the app?

I/chromium: [INFO:CONSOLE(1)] "Uncaught TypeError: Cannot read property 'theme' of null", source: 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");
yasintamer
  • 43
  • 7

1 Answers1

2

You can try

webSettings.setDomStorageEnabled(true);

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