Android:找不到同步适配器

时间:2011-06-16 17:09:29

标签: android provider accountmanager

为什么Android在我打电话时找不到我的同步适配器:

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"
/>

我已经尝试了一切

现在我哭了:'(

1 个答案:

答案 0 :(得分:0)

发现!!!!

android:contentAuthority而不是我的syncadapter.xml文件中的contentAuthority

还有android:accountType而不是accountType