0
我正在嘗試使用Google帳戶設置SyncAdapter。我在教程中做了所有事情,但我的適配器仍然在設置菜單中不可見。SyncAdapter未顯示在設置菜單中
因此,這裏是我的Android清單:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="pl.example.tasks"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="15" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_CONTACTS" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.MANAGE_ACCOUNTS" />
<uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS" />
<uses-permission android:name="android.permission.READ_SYNC_SETTINGS" />
<uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS" />
<uses-permission android:name="android.permission.USE_CREDENTIALS" />
<application
android:name=".TasksApplication"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<service
android:name="TasksSyncAdapterService"
android:description="@string/tasks_sync_descr"
android:exported="true"
android:icon="@drawable/ic_launcher"
android:label="@string/tasks_sync_label"
android:process="@string/tasks_sync_process" >
<intent-filter>
<action android:name="android.content.SyncAdapter" />
</intent-filter>
<meta-data
android:name="android.content.SyncAdapter"
android:resource="@xml/taskssync" />
</service>
<activity
android:name=".MainActivity"
android:label="@string/title_activity_main" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<provider
android:name=".TasksContentProvider"
android:authorities="pl.example.tasks" />
</application>
這裏是我taskssync.xml:
<sync-adapter xmlns:android="http://schemas.android.com/apk/res/android"
android:accountType="com.google"
android:contentAuthority="pl.example.tasks"
android:supportsUploading="false"
android:userVisible="true" />
請給我一些導遊可能是什麼錯在這裏。
或者,通過代碼'ContentResolver.setIsSyncable(account,authority,1);' – rds 2012-12-05 22:11:00