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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T11:56:53+00:00 2026-06-18T11:56:53+00:00

I am trying to set up a loading circle to show up in my

  • 0

I am trying to set up a loading circle to show up in my android web view app. I have made a ton of progress since I started. Right now I am getting an error with the line setProgress.

The error message is:

The method setProgress(int) is undefined for the type new WebChromeClient(){}

import android.os.Bundle;
import android.app.Activity;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.Window;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.webkit.WebChromeClient;

public class MainActivity extends Activity 
{   
    //Configure the webview setup in the xml layout
    public WebView myWebView;


     @Override
        public void onCreate(Bundle savedInstanceState) 
        {
            super.onCreate(savedInstanceState);
            //Remove title bar as we already have it in the web app
            this.requestWindowFeature(Window.FEATURE_NO_TITLE);

            getWindow().requestFeature(Window.FEATURE_PROGRESS);
            //Point to the content view defined in XML
            setContentView(R.layout.activity_main);
            myWebView = (WebView) findViewById(R.id.webview);
            myWebView.getSettings().setJavaScriptEnabled(true);
            myWebView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);


            WebSettings webSettings = myWebView.getSettings();
            //Yes, we want javascript, pls.

            webSettings.setJavaScriptEnabled(true);
            //Make sure links in the webview is handled by the webview and not sent to a full browser
            myWebView.setWebViewClient(new WebViewClient());
            //And let the fun begin
            myWebView.loadUrl("http://www.google.com");

            myWebView.setWebChromeClient(new WebChromeClient() {
                 public void onProgressChanged(WebView view, int progress) {
                  // Activities and WebViews measure progress with different scales.
                  // The progress meter will automatically disappear when we reach 100%
                  this.setProgress(progress * 100);

                 }});

        }



    @Override
    public void onBackPressed(){
        myWebView.goBack();
    }


}
  • 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-18T11:56:54+00:00Added an answer on June 18, 2026 at 11:56 am

    Do instead

    MainActivity.this.setProgress(progress * 100);
    

    or just

    setProgress(progress * 100);
    

    So that you refer explictly to the parent class instance. Doing just this when inside the WebChromeClient refers to the instance of that class, and so you get a compile time error.

    Since you are working with WebView, see the documentation for more info about WebViews and everything else related (including clients).

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

Sidebar

Related Questions

I'm trying to set up a web app (32bit on ii7/win7, 32bit setting is
I am trying to load a web view (called widget) and set an indicator
I have a simple web page which I've been trying to set up a
Trying to set up a self signed certificate, for our intranet's web services site.
Trying to set up Cancan within an app of mine and having trouble with
I am trying to set text when loading a php file... I am doing
I am trying to set the text label of a second view controller from
I am trying to set a custom route for friendly url when loading a
I'm loading an HTML page in an iframe and trying to set the font-size
I am trying to set a style, which is defined in the App.xaml ,

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.