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 7991641
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T13:20:56+00:00 2026-06-04T13:20:56+00:00

I am working on a tablet application which has 2 fragments on the screen.

  • 0

I am working on a tablet application which has 2 fragments on the screen. One fragment is a WebView. By default the user does not get any feedback to let them know the webpage is loading.

To give the user feedback I show a progress dialogue when the page loading is started and remove it when the page has finished. This works well in most cases except when a link redirects multiple times.

When redirects occur the dialogue is shown and dismissed multiple times which looks pretty bad. I guess it would be acceptable if I could stop the dialogue from dimming the background, but after searching for a while I have not found a way of doing this.

Ideally It would be nice if I could just add a loading bar over the centre of the webview fragment and hide/dismiss it when finished. Any ideas?

private class InnerWebViewClient extends WebViewClient {
    @Override
    public boolean shouldOverrideUrlLoading(WebView view, String url) {

        view.loadUrl(url);
        return true;
    }

    @Override
    public void onPageStarted(WebView view, String url, Bitmap favicon) {
        if (dialog==null)
            dialog = new ProgressDialog(getActivity());
        dialog.setMessage("Loading...");
        dialog.setIndeterminate(true);
        dialog.setCancelable(false);
        dialog.show();
        Log.d("WEBVIEW", "loading "+ url);
        super.onPageStarted(view, url, favicon);
    }

    @Override
    public void onPageFinished(WebView view, String url) {
        dialog.dismiss();
        mUrl=url; // save final url so user can open in deafult browser
        super.onPageFinished(view, url);
    }

}
  • 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-06-04T13:20:58+00:00Added an answer on June 4, 2026 at 1:20 pm

    I have just done this in what I think is a very elegant way.

    I have made a custom layout, which contains a webview and a progress dialogue in the centre. This dialogue is initially set to GONE and set visible when a webpage is loading in the onPageStarted. It is set to GONE again in the onPageFinished method.

    The Fragment inflates and returns this custom view in the onCreateView method.

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

Sidebar

Related Questions

I am currently working on an Android tablet application which has two fragments, a
I am currently working on one android application which has C2DM implementation and I
I'm working in mid-size .NET application which has a very very bad if not
I'm working on an application which has different types of users i.e. students, tutors,
I was working on an intranet application which has been working on quirks mode
I'm working on an application which allows one to list movies as well edit,
I have a working web application which already has a login and registration system.
I'm working on an application which uses data from db which has to be
I'm working on a web application which has suddenly become extremely unresponsive in Google
I am developing an application for Android Tablet, which has Facebook and Twitter integration.

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.