How to run progressDialog inside WebView ?

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


Sponsored Links
 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();

                }
        };

    }

--



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 https://dl-ssl.google.com/android/repository/repository.xml,
reason: HTTPS SSL error. You might want to force download through HTTP
in the settings.
..wondering what else is involved.
thanks for help
99

-- 

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: http://blog.mylookout.com/2010/12/android-touch-event-hijacking/
Proof of Concept Video:  http://vimeo.com/17648348
Advisory: http://blog.mylookout.com/look-10-007-tapjacking/

-Anthony

-- 
.

3. Hi..email validation problem

4. Abridged summary of android-developers@googlegroups.com - 84 Messages in 39 Topics

5. android's radio transmitter API?

6. Browser screen flickering

7. Banting harga WTS : HTC Magic 2nd