1. Are you ready for the Galaxy S20? Here is everything we know so far!

html page is not loading in webviewclient

Discussion in 'Android Lounge' started by TeimoorAlam, Dec 22, 2011.

  1. TeimoorAlam

    TeimoorAlam Lurker
    Thread Starter

    Hy,
    my question is that,my local html file that exist in asset's folder is only loading in webview not in webviewclient.
    iam passing querystring from one page to another and want to get that querystring in onLoadResource() method of webviewclient.here is mycode but its not working

    public void onCreate(Bundle savedInstanceState)
    {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    progressBar=(ProgressBar)findViewById(R.id.progressbar);
    mWebView = (WebView) findViewById(R.id.webview);
    mWebView.getSettings().setJavaScriptEnabled(true);
    mWebView.getSettings().setSavePassword(false);
    mWebView.getSettings().setSaveFormData(false);
    progressBar.setVisibility(ProgressBar.GONE);
    mWebView.setWebChromeClient(new WebChromeClient()
    {

    });
    mWebView.setWebViewClient(new WebViewClient()
    {
    public boolean shouldOverrideUrlLoading(WebView view, String url)
    {


    view.loadUrl (url);
    //mWebView.loadData("", "text/html", "utf-8");
    return false;
    }
    });

    mWebView.loadUrl("file:///android_asset/abc.html");

    }
     



    1. Download the Forums for Android™ app!


      Download

       
Loading...

Share This Page

Loading...