简体   繁体   中英

Android service not starting

I'm developing an app with a service (inherited from Service ). The service is started via the manifest:

<application ...>
  ...
  <service android:enabled="true" android:name=".NotificationService" />
</application>

This used to work. Now, suddenly (with no apparent change in the code), it stopped working. When I debug my app, the service simply does not start .

  • Yes, the service is in the same package as the main activity.
  • Yes, the service tag is inside the application tag.
  • Yes, I have uninstalled my app to ensure I have a clean environment.
  • Yes, I have rebooted my device several times.
  • No, a Debug.waitForDebugger() in the service does not trigger.

I have cleaned the project. I have restarted Eclipse. Not sure what more I can try. Please help!

startService was never called. Hence, an error in my code. My question does however pinpoint a couple of gotchas that may prove useful :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM