简体   繁体   English

Android Sync Adapter Service未调用onCreate

[英]Android Sync Adapter Service not calling onCreate

I am having trouble getting the service started for Sync Adapter and Accounts. 我无法启动针对同步适配器和帐户的服务。 The framework doesn't call onCreate methods. 该框架不调用onCreate方法。

For Sync Adapter, 对于同步适配器,

I have create following components: 我创建了以下组件:

  1. Sync Service (class that extends Service ) 同步服务( extends Service类)
  2. Sync Adapter (class that extends AbstractThreadedSyncAdapter ) 同步适配器( extends AbstractThreadedSyncAdapter类)
  3. Sync_Adapter.xml Sync_Adapter.xml
  4. AuthenticatorService (class that extends Service ) AuthenticatorService( extends Service类)
  5. Authenticator ( extends AbstractAccountAuthenticator ) Authenticator( extends AbstractAccountAuthenticator
  6. account_authenticator.xml account_authenticator.xml

And updated the entry in the manifest.xml 并更新manifest.xml中的条目

And that's it. 就是这样。

I don't see any logs reported from onCreate from either services. 我看不到任何服务的onCreate报告的任何日志。 Do I have to manually start them? 我必须手动启动它们吗?

Please help. 请帮忙。

Cheers, Raj 干杯,拉吉

I have followed the documents to create 我已按照文档创建

The documents I have followed to write sync adapter are: https://developer.android.com/training/sync-adapters/creating-sync-adapter.html http://blog.udinic.com/2013/04/24/write-your-own-android-authenticator/ https://github.com/Udinic/SyncAdapter/tree/master/SyncAdapterExample 我遵循的编写同步适配器的文档是: https : //developer.android.com/training/sync-adapters/creating-sync-adapter.html http://blog.udinic.com/2013/04/24/ write-your-own-android-authenticator / https://github.com/Udinic/SyncAdapter/tree/master/SyncAdapterExample

我建议您首先从android团队下载并运行Sample SyncAdapter应用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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