2017-02-04 108 views

回答

0

這可能是遲到的回覆,但它可以幫助他人。

創建具有不同的內容提供

<service android:exported="true" android:name="com.sync.Sync1AdapterService"> 
    <intent-filter> 
    <action android:name="android.content.SyncAdapter" /> 
    </intent-filter> 
    <meta-data android:name="android.content.SyncAdapter" android:resource="@xml/sync_adapter1" /> 
</service> 
<service android:exported="true" android:name="com.example.Sync2AdapterService"> 
    <intent-filter> 
    <action android:name="android.content.SyncAdapter" /> 
    </intent-filter> 
    <meta-data android:name="android.content.SyncAdapter" android:resource="@xml/sync_adapter2" /> 
</service> 

sync_adapter1

<sync-adapter xmlns:android="http://schemas.android.com/apk/res/android" 
    android:contentAuthority="sync1" 
    android:accountType="com.sync.example" 
    android:allowParallelSyncs="true" /> 

sync_adapter2

<sync-adapter xmlns:android="http://schemas.android.com/apk/res/android" 
    android:contentAuthority="sync2" 
    android:accountType="com.sync.example" 
    android:allowParallelSyncs="true" /> 
多個同步適配器
相關問題