How to run progressDialog inside WebView ?

by teeming » Sat, 24 Apr 2010 01:48:37 GMT

Sponsored Links

I am new to android development. I wanted to create an app that
displaying a progressDialog when loading the webpage using
webview.loadurl. However i couldn't make my code run. The app is
loaded with error in the emulator. Below is my code. Hope anybody can
help me trace the problem. Thanks.

package hello.WebView;

import android.view.KeyEvent;
import android.webkit.*;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;

public class HelloWebView extends Activity implements Runnable {

        WebView webview;
        private ProgressDialog pd;
    /** Called when the activity is first created. */
    public void onCreate(Bundle savedInstanceState) {


        public boolean onKeyDown(int keyCode, KeyEvent event) {

                pd =, "", "Loading...", true,

                Thread thread = new Thread(this);

                return super.onKeyDown(keyCode, event);

        public void run() {

                webview.loadUrl(" ");

        private Handler handler = new Handler() {
                public void handleMessage(Message msg) {




How to run progressDialog inside WebView ?

by Kumar Bibek » Mon, 26 Apr 2010 13:39:48 GMT

 You can put a progressbar inside a WebView and set or unset it's
visibility. That should solve your problem.

Thanks and Regards,
Kumar Bibek


Sponsored Links

Other Threads

1. I can't get Android SDK setup to activate

I've downloaded all the installation files for the Android SDK , but I
cannot get the setup.exe file to get past this message:
Failed to fetch URL,
reason: HTTPS SSL error. You might want to force download through HTTP
in the settings.
..wondering what else is involved.
thanks for help


2. TapJacking: Android Touch Event Hijacking

The release of Android 2.3 (Gingerbread) added a new attribute to the
View class: filterTouchsWhenObscured. This attribute is a fix to a
problem a member of our team found that we reported to the Android
Security Team. TapJacking, similar to ClickJacking attacks in web
UI's, allows an attacker to hijack touchscreen activity in native
Android applications. A malicious app could trick the user into
interacting with potentially sensitive Activities. We have written up
a detailed post explaining the problem and and a little bit about
using the new method/attribute in development to protect against this.
We have also posted a video POC of the problem. Thanks to the Android
Security Team for getting this fix put into the lastest release!

Detailed Post:
Proof of Concept Video:



3. validation problem

4. Abridged summary of - 84 Messages in 39 Topics

5. android's radio transmitter API?

6. Browser screen flickering

7. Banting harga WTS : HTC Magic 2nd