Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 903395
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T15:52:16+00:00 2026-05-15T15:52:16+00:00

I have an issue with Webview. I’m programming my own WebChromeClient class overriding onProgressChanged

  • 0

I have an issue with Webview. I’m programming my own WebChromeClient class overriding onProgressChanged method because I want to show the page when it finishes loading and then, to hide the splash screen. As I just want it to happen with a specific URL, I compare the actual WebView URL with a specific string, but there is a problem, I get a null pointer when webview.getUrl() method is called and my application finishes.

This is the code:

private class MyWebChromeClient extends WebChromeClient {
    @Override
    public void onProgressChanged (WebView webview, int newProgress) {
        super.onProgressChanged(webview,newProgress);
        if(webview.equals(w1) && newProgress == 100 && webview.getUrl().startsWith("https://ssl.facebook.com/login.php")) { 
            webview.setVisibility(WebView.VISIBLE);
            ImageView imageview = (ImageView)findViewById(R.id.ivsplash);
            imageview.setVisibility(ImageView.GONE);
            ProgressBar progressbar = (ProgressBar)findViewById(R.id.pbsplash);
            progressbar.setVisibility(ProgressBar.GONE);
        }
    }
}

I do this for avoid the webview takes three or four seconds to render the page, but it doesn’t work. The code I used before was:

private class MyWebViewClient extends WebViewClient {
    @Override
    public boolean shouldOverrideUrlLoading(WebView webview, String url) {
        super.shouldOverrideUrlLoading(webview, url);
        webview.loadUrl(url);
        return true;
    }
    
    @Override
    public void onPageFinished(WebView webview, String url) {
        if(url.startsWith("https://ssl.facebook.com/login.php")) {
            webview.setVisibility(WebView.VISIBLE);
            ImageView imageview = (ImageView)findViewById(R.id.ivsplash);
            imageview.setVisibility(ImageView.GONE);
            ProgressBar progressbar = (ProgressBar)findViewById(R.id.pbsplash);
            progressbar.setVisibility(ProgressBar.GONE);
        }
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T15:52:16+00:00Added an answer on May 15, 2026 at 3:52 pm

    Not sure if this is possible with WebChromeClient, but I was able to do this using

    WebViewClient and overloading onLoadResource, onReceivedError and onPageFinished

    This is what I’ve done

    onLoadResource     
     mwebview.setVisibility(View.GONE);
    
    
    onReceivedError
    mwebview.setVisibility(View.VISIBLE);
    
    onPageFinished
    mwebview.setVisibility(View.VISIBLE);
    

    and intially in XML the webview is set as GONE

    android:visibility="gone"
    

    I too use it for Facebook and works fine.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 512k
  • Answers 512k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer It looks like you need to update Visual Studio's configuration… May 16, 2026 at 5:30 pm
  • Editorial Team
    Editorial Team added an answer #define DeviceSpecificResourceName(name) [SMDeviceManager deviceSpecificResourceName:(name)]; // ^ remove Remove the final… May 16, 2026 at 5:30 pm
  • Editorial Team
    Editorial Team added an answer The general order of code for creating a GUI is:… May 16, 2026 at 5:30 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I have an issue that looks like a race condition with a webview callback
I have the following setup webview = [[UIWebView alloc] initWithFrame:[UIScreen mainScreen].bounds]; Occasionally I issue
I have an application with many views. I want only a couple of the
I have a webview and am trying to load simple UTF-8 text into it.
I am having issue while showing a WebView in an activity in the middle
Ok, I understand that using strings that have special characters is an encoding issue.
I have a page I am developing in .net using HTML5 intended for a
I have an issue. 1. I have two threads: 'worker' and 'UI' thread. 2.
I have a WebView inside the ScrollView . The content of WebView dyanamically changes
i have issue with comparing NAN value in C++, Visualstudio. I need to handle

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.