【发布时间】:2011-06-16 17:09:28
【问题描述】:
为什么我打电话时安卓找不到我的同步适配器:
ContentResolver.setSyncAutomatically(account, "com.stevegrosbois.budget.provider", true);
我已经搜索了几个小时:
在日志中:
DEBUG/SyncManager(59): can't find a sync adapter for SyncAdapterType Key {name=com.stevegrosbois.budget.provider, type=com.stevegrosbois.budget.user}, removing settings for it
AndroidManifest.xml
<service android:name=".sync.SyncService" android:exported="true">
<intent-filter>
<action android:name="android.content.SyncAdapter" />
</intent-filter>
<meta-data android:name="android.content.SyncAdapter" android:resource="@xml/syncadapter" />
</service>
syncadapter.xml:
<sync-adapter xmlns:android="http://schemas.android.com/apk/res/android"
contentAuthority="com.stevegrosbois.budget.provider"
accountType="com.stevegrosbois.budget.user"
android:supportsUploading="true"
android:userVisible="true"
/>
我什么都试过了
现在我哭了:'(
【问题讨论】:
-
manifest中如何定义provider?是否使用提供程序?你必须定义一个你可能不会使用它。
标签: android provider accountmanager