ok.. i managed to do it by putting the setText() in the
runInUIThread...

On Aug 18, 1:29 pm, Mystique <[email protected]> wrote:
> Hi all, please help me look at my code. Many thanks.
>
> --- code ---
> private Handler handler = new Handler();
> private ProgressDialog dialog;
>
> final Runnable runInUIThread = new Runnable()  {
>     public void run() {
>         dialog.dismiss();
>     }
>
> };
>
> private void DoThis() {
>     dialog = new ProgressDialog(Main.this);
>     dialog.setTitle("Title");
>     dialog.setMessage("Text");
>     dialog.show();
>
>     Thread newTask = new Thread() {
>         @Override
>          public void run() {
>                 Looper.prepare();
>                 DoThat();
>                 handler.post(runInUIThread);
>                 Looper.loop();
>          );
>          newTask.start();
>        }}
>
> --- code ---
>
> Is it possible to use test.setText("something") in this thread to
> update a Button text or TextView in the LinearLayout after the dialog
> is dismissed? I try cheating placing:
>
> test.setVisibility(View.INVISIBLE);
> test.setText("something");
> test.setVisibility(View.VISIBLE);
>
> after dialog.show();
> It kind of updated the text when the dialog open. I want to do it
> after the dialog was dismissed. What is the correct way to implement
> this in my thread?

-- 
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