簡體   English   中英

使用同步適配器自動同步本地數據庫

[英]Auto sync for local DB with sync adapters

我正在使用同步適配器編寫一個同步應用程序,並嘗試自動同步本地數據庫,第一次創建帳戶時它運行良好,但是當我在本地數據庫中進行更改時,即使我設置了ContentResolver.setSyncAutomatically(帳戶,AUTHORITY,正確)。

嘗試這個

ContentResolver.setIsSyncable(account, authority, 1);
ContentResolver.setSyncAutomatically(account, authority, true);
ContentResolver.addPeriodicSync(account, authority, new Bundle(), 1);

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM