Hello,

Here is my code:
--------------------------------------
final Handler mHandler = new Handler(){
                                public void handleMessage(Message msg) {
                                        if(location!=null){
                                                Log.i(TAG, "got message from 
handler");
                                                dismissDialog(DIALOG1_KEY);
                                                //this.getLooper().quit();
                                        }
                                }
                        };
                        showDialog(DIALOG1_KEY);


                        new Thread(new Runnable() {

                                public void run() {

                                        Looper.prepare();
                                                                        try {
                                                                                
Thread.sleep(100);
                                                                        } catch 
(InterruptedException e) {
                                                                                
// TODO Auto-generated catch block
                                                                                
e.printStackTrace();
                                                                        }
                                                                
mHandler.sendEmptyMessage(0);
                                        Looper.loop();
                                }//end of run
                        }).start();
--------------------------------
The problem is as follows:
progressBar is showing correctly. mHandler obtains the message but
only once(for the first time). But I need to make it in loop(as
Looper.loop should have worked in this case), so it calls mHandler
handleMessage in every loop(but its not happening in this case).
The outcome progressBar kept on rotating though the condition in the
handleMessage (if(location!=null) )is getting satisfied in the mean
time of the active progressbar.
How can I make mHandle,sendEmptyMessage to call in each loop so I can
check for this (if(location!=null)) condition.

Any Suggestion would be very helpful

ag

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

Reply via email to