kaloer wrote:
> When I debug my application, it suddenly disconnects from the DalvikVM
> without throwing an exception. Regarding this, the emulator shows an
> ANR dialog. It happens some time after I have started a service to do
> an operation, by a Broadcast receiver. The operation does take pretty
> long time, because it is parsing a xml document. It does not stop
> after a special point in my code. I know that a Broadcast receiver
> needs to be executed fast, but when I start a service by the
> context.startService(Intent) method it shouldn't wait for the
> service's execution, should it?
All callbacks from Android need to be done quickly. This includes
starting services. Only work done on threads of your own creation can
take longer.
> I've attached the log (which do have a line with
> "07-18 20:35:24.148: WARN/ActivityManager(583): Timeout executing
> service: ServiceRecord{43818238
> com.kaloersoftware.flickrwall/.FlickrWallService}"
Something in your service (onCreate() or onStart(), most likely) is
taking too long.
> Can it help if I do the xml parsing in a thread?
Yes. Use AsyncTask or something to move the XML parsing off the thread
used for the callback.
--
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy
Need Android talent? Ask on HADO! http://wiki.andmob.org/hado
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" 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-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---