繁体   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