Hi,
I want to start a service at bootup.
I've done a breoadcast receiver, started a service from broadcastreceiver, all inserted in xml.
The tutorial from
http://www.androidcompetencycenter.com/2009/06/start-service-at-boot/ helped me a lot.
The result:
On emulator, as on real device happens like this:
- service is started and then immediately stopps!
I don't know why the service stops!
The service is started for sure, I can read logs and toast msg. that certifies the service is started.
Also in logs I can see some msg like:
05-17 23:18:44.379: D/EAS SyncManager(247): !!! EAS SyncManager, onCreate
05-17 23:18:44.789: D/EAS SyncManager(247): !!! EAS SyncManager, onStartCommand
05-17 23:18:44.860: D/EAS SyncManager(247): !!! EAS SyncManager, stopping self
05-17 23:18:44.999: D/My Service(258): starting broadcast receiver
05-17 23:18:45.119: D/My Service(258): starting service in onCreate
05-17 23:18:45.985: D/Eas Debug(247): Logging:
05-17 23:18:45.999: D/EAS SyncManager(247): !!! EAS SyncManager, onDestroy
05-17 23:18:46.299: I//system/bin/fsck_msdos(29): Attempting to allocate 998 KB for FAT
The EAS SyncManager is destroyed. I belive this is the cause why my service is forced stopped.
From what I've read from
http://hi-android.info/src/com/android/exchange/SyncManager.java.html it seams that when EAS SyncManager is destroyed, the started service on boot, receives a StopSelf() by default.
I don't know if this is true or not.
And if it is true... how can I fix it?
Does anyone confrunted with this until now?
Please help.