TreKing,

> What does "cannot get it to work" mean?
Well... The following code does not produce any Eclipse errors but
does produce the "Sorry! App has stopped unexpectedly..." when I try
to run it on the emulator, AVD.

        private class getNextBook_T extends AsyncTask<Void, Void, Integer> {
                private ProgressDialog pd1;
                protected Integer doInBackground(Void... arg0 ) {
                        pd1 = ProgressDialog.show(App01.this, "", "Downloading 
next
book...", true);
                        return getNextBook();
                }
                protected void onPostExecute(Integer result) {
                pd1.dismiss();
                setDisplay("");
                }
        }

The DDMS LogCat display shows:
03-28 15:42:32.132: ERROR/AndroidRuntime(227): Caused by:
java.lang.RuntimeException: Can't create handler inside thread that
has not called Looper.prepare()

Thanks, John
I did get it to work. Your post prompted me to try it a different way.
I just didn't get it at first.

Thanks, John Brown


On Mar 28, 11:27 am, TreKing <[email protected]> wrote:
> On Mon, Mar 28, 2011 at 12:21 PM, john brown
> <[email protected]>wrote:
>
> >  I want to call the ProgressDialog directly from the
> > AsyncTask getNextBook_T, but I cannot get it to work.
>
> What does "cannot get it to work" mean?
>
> > Is there a way to implement the ProgressDialog directly from getNextBook_T?
>
> Yes.
>
> > Or is it OK (or necessary) to do it indirectly like the code shows?
>
> OK? Sure. Necessary? No.
>
> --------------------------------------------------------------------------- 
> ----------------------
> TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago
> transit tracking app for Android-powered devices

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