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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:14:43+00:00 2026-06-12T09:14:43+00:00

what is issue in this code it says force close? error occurred when using

  • 0

what is issue in this code it says force close?
error occurred when using progress dialog

ourBrow = (WebView) findViewById(R.id.wvBrowser);
ourBrow.setBackgroundColor(Color.parseColor("#000000"));
ourBrow.getSettings().setJavaScriptEnabled(true);
ourBrow.setWebViewClient(new WebViewClient() {
    ProgressDialog dialog;
    @Override
    public boolean shouldOverrideUrlLoading(WebView view, String url) {
        dialog = ProgressDialog.show(Moile_gole.this, "",
                    "Loading. Please wait...", true);
        ourBrow.loadUrl(url);
        return true;
    }

    @Override
    public void onPageFinished(WebView view, String url) {
        dialog.dismiss();
            // HIDE PROGRESS DIALOG LOADING IT HAS FINISHED
        }

    });

    ourBrow.loadUrl("http://www.google.com");

Logcat:

10-03 20:43:59.440: D/AndroidRuntime(304): Shutting down VM 10-03 20:43:59.440: W/dalvikvm(304):
threadid=1: thread exiting with uncaught exception (group=0x4001d800) 10-03 20:43:59.461: E/AndroidRuntime(304): FATAL EXCEPTION: main 
10-03 20:43:59.461: E/AndroidRuntime(304): java.lang.NullPointerException 
10-03 20:43:59.461: E/AndroidRuntime(304): at com.mobile.specification.Moile_Specification$2.onProgressChanged(Moile_Specifica‌​tion.java:68) 
10-03 20:43:59.461: E/AndroidRuntime(304): at android.webkit.CallbackProxy.handleMessage(CallbackProxy.java:358)
10-03 20:43:59.461: E/AndroidRuntime(304): at android.os.Handler.dispatchMessage(Handler.java:99) 
10-03 20:43:59.461: E/AndroidRuntime(304): at android.os.Looper.loop(Looper.java:123)
10-03 20:43:59.461: E/AndroidRuntime(304): at android.app.ActivityThread.main(ActivityThread.java:4627) 
10-03 20:43:59.461: E/AndroidRuntime(304): at java.lang.reflect.Method.invokeNative(Native Method) 
10-03 20:43:59.461: E/AndroidRuntime(304): at java.lang.reflect.Method.invoke(Method.java:521) 
10-03 20:43:59.461: E/AndroidRuntime(304): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868) 
10-03 20:43:59.461: E/AndroidRuntime(304): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) 
10-03 20:43:59.461: E/AndroidRuntime(304): at dalvik.system.NativeStart.main(Native Method)
  • 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-12T09:14:43+00:00Added an answer on June 12, 2026 at 9:14 am

    Force Close Error is occurred due to NullPointerException caused by dialog. shouldOverrideUrlLoading() method is called only when links inside a WebView are clicked and not called when you try to load webpage via webview.loadUrl(url). So here your dialog is not initialized and causing the NullPointerException.

    I suggest you to use webchromeclient and ProgressBar(pb) to show the webpage loading Progress as below sample.

    wv.setWebChromeClient(new WebChromeClient(){
    
             public void onProgressChanged(WebView view, int progress) 
             {
    
                 pb.setProgress(progress);
                 if(progress==100)
                     pb.setVisibility(View.GONE);
              }
    
    
        });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What is the issue with this code? Here we have two files: classA.h and
Let me know if anyone know what is the issue with this code. Basically
I am having trouble figuring out where my issue with this code is. My
i have this quick issue please. I have this code here which permits me
I found out the next issue in this simple code: let () = print_endline
Hey friends any one please help me for this issue.in this javascript code i
I've an issue with this piece of code: NSURL *url = [[NSURL alloc] initWithString:@http://authenticate.radonsystems.net/products.xml];
I use this code , to log $_SERVER['REMOTE_ADDR']; to my small db my issue
This issue is somewhat related: Problem with Code Generated by XSD.EXE: Sequence of Elements
I've first observed this issue in a production code, then made a prototype: import

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.