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. How to stop the device from sleeping


I released a "Hypnotic Spiral" demo on the market yesterday. One of
the most requested features from the comments I've received is to stop
the phone from sleeping after a few minutes of no use. Is there a way
to deep the phone awake while my activity is running?


2. How to and new browser plugin


I want to add a new browser plugin and i can see there is a plugin present
names in Browser/assets/plugins folder and some html files inside
gears-04.23.0 folder .
I had created a plugin by using Netscape Plugin functionality and i had
build file .
I am not sure what to do next .

For testing purpose i had put my file in "Browser/assets/plugins"
path name so
that the Browser.apk will have my file but that did not worked .
I think plug in should work if i can reflect my file in
"data/data/" .

Can someone guide me what to do next .
Hope to see some positive response.



3. Usbnet on android

4. WebView/Browser: How to browse files from the sdcard?

5. OpengGL ES Mouse/Touch Events

6. Concern about application file size for publishing due to Media files

7. Animation image