📜  显示来自 firebase android studio 的 html 文件 - Html 代码示例

📅  最后修改于: 2022-03-11 14:53:15.150000             🧑  作者: Mango

代码示例1
WebView webView = (WebView)findViewById(R.id.web_view);
     // be cautious before enabling javascript, check security guidelines by google.
    //webView.getSettings().setJavaScriptEnabled(true);
    webView.setWebViewClient(new WebViewClient(){

        @Override
        public void onPageStarted(WebView view, String url, Bitmap favicon) {
            // on page load started, you may show progress spinner to user.
            //progressBar.setVisibility(View.VISIBLE);
            super.onPageStarted(view, url, favicon);
        }

        @Override
        public void onReceivedError(WebView view,
            WebResourceRequest request, WebResourceError error) {
            // ERROR handling
            super.onReceivedError(view, request, error);

        }

        @Override
        public void onPageFinished(WebView view, String url) {
            // actions on page load
            super.onPageFinished(view, url);
        }

    });
    webView.loadUrl(url);