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

On Apr 23, 3:02 pm, teeming <looteem...@gmail.com> wrote:
> Hi,
>
> 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.app.Activity;
> import android.app.ProgressDialog;
> 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. */
>     @Override
>     public void onCreate(Bundle savedInstanceState) {
>
>         super.onCreate(savedInstanceState);
>     }
>
>         @Override
>         public boolean onKeyDown(int keyCode, KeyEvent event) {
>
>                 pd = ProgressDialog.show(this, "", "Loading...", true,
>                                 false);
>
>                 Thread thread = new Thread(this);
>                 thread.start();
>
>                 return super.onKeyDown(keyCode, event);
>         }
>
>         public void run() {
>
>                 webview.loadUrl("http://m.adoimagazine.com";);
>                 setContentView(webview);
>                 handler.sendEmptyMessage(0);
>
>         }
>         private Handler handler = new Handler() {
>                 @Override
>                 public void handleMessage(Message msg) {
>                         pd.dismiss();
>
>                 }
>         };
>
>     }
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group 
> athttp://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to