【问题标题】:Android : can't find a sync adapterAndroid:找不到同步适配器
【发布时间】: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


【解决方案1】:

找到了!!!!

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

还有 android:accountType 而不是 accountType

【讨论】:

    猜你喜欢
    • 2013-11-24
    • 1970-01-01
    • 2013-01-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多