Rather than using Thread.sleep(), use a Handler object instead, use
Handler.postDelayed() . Using Thread.sleep in a GUI app will cause it
to time out.
Mark
On Dec 11, 8:13 am, "Andrew Stadler" <[email protected]> wrote:
> Sukumar-
>
> The activity manager assumes that your code has died, because it did
> not return from the broadcast receiver in a "reasonable" amount of
> time. In general, receivers should execute very very quickly, and any
> long-term operations (such as *any* network operations) should be on
> their own thread(s).
>
> Hope this helps,
> Andy
>
>
>
> On Thu, Dec 11, 2008 at 7:26 AM, sukumar <[email protected]> wrote:
>
> > hi,
>
> > I created a service which is launched by BOOT_COMPLETE event. The
> > launched service needs to make httpget and store the data. If httpget
> > fails, my serivce needs to make 2 httpget attempts with interval of
> > 30s.To wait for 30sec, I used Thread.sleep() call.
>
> > The problem Im facing is, once I make Thread.sleep() call, my service
> > is kill by Iprocess activity.and I see activityManager log as below
> > (nabservice is my service name)
> > W/ActivityManager( 59): Timeout executing service: ServiceRecord
> > {4316d2a0 com.nabservice/.NotifyInfoUser}
>
> > Pls correct me, If Im doing wrong. Shouldnt I call Thread.sleep() for
> > wait in a service ? Thanks in Advance.
>
> > Regards,
> > Sukumar.- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---