Thanks for the reply...

I know there is a lot of code, but I thought too much is better than
too few.
Answering your propositions:

1) Effectively, I discarded the getApplicationContext pretty fast.
2) I know that the AsycTask is aimed for that exactly.
I just would like to understand why this code don't work now.
I don't see why a threaded object would not be good enough in that
case.
But I'm seriously thinking about rewriting my worker to an AsyncTask
3) Here, you lost me.... I was thinking that I was calling them from
the activity!?
In fact, I can resume the current flow by:
*[main] Start of the application
*[main] Instantiate a new KivaWorker thread
*[KivaThread] Load a page => send a message PAGE_LOADING to the
handler
*[main] Handler get PAGE_LOADING, call inProgress()
*[main] inProgress display the ProgressDialog
*[KivaThread] end loading  a page, send PAGE_LOADED to the handler
*[main] Handler get PAGE_LOADED, call doneProgress()
*[main] doneProgress dismiss the previously opened ProgressDialog
...Now, the user does something, and a new page must be loaded
*[KivaThread] Load a page => send a message PAGE_LOADING to the
handler
*[main] Handler get PAGE_LOADING, call inProgress()
   => here, no ProgressDialog is displayed, but the Log.i() shows me
the code is run
*[KivaThread] end loading  a page, send PAGE_LOADED to the handler
*[main] Handler get PAGE_LOADED, call doneProgress()

Each and every examples I found are using a new Thread(){}; pattern,
and calling the dismiss() from that block.


On Apr 19, 3:59 pm, "~ TreKing" <treking...@gmail.com> wrote:
> On Mon, Apr 19, 2010 at 3:10 AM, tripy <tsch...@gmail.com> wrote:
> > Can anyone explain me what is wrong with my code?
>
> That's a lot of code to wade through and it's not formatted well at all in
> this email so I only quickly skimmed. Nothing obviously wrong, AFAICT, but
> some suggestions:
>
> 1 - Don't use getApplicationContext() (it's in a comment, that's probably
> why you had an exception)
> 2 - Trying using an AsyncTask for your background work
> 3 - Try using showDialog() and dismissDialog() in Activity instead of doing
> so on the Dialog instance itself
>
> Hope that helps.
>
> -------------------------------------------------------------------------------------------------
> TreKing - Chicago transit tracking app for Android-powered 
> deviceshttp://sites.google.com/site/rezmobileapps/treking
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Beginners" group.
>
> NEW! Try asking and tagging your question on Stack Overflow 
> athttp://stackoverflow.com/questions/tagged/android
>
> To unsubscribe from this group, send email to
> android-beginners+unsubscr...@googlegroups.com
> For more options, visit this group 
> athttp://groups.google.com/group/android-beginners?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en

Reply via email to