【发布时间】:2012-12-13 12:37:53
【问题描述】:
我正在尝试了解用户是否将 Google 照片 (picasa) 设置为在其设备上同步。有没有办法以编程方式确定是否为用户手机上设置的任何 Google 帐户开启了同步?
另外,有没有办法以编程方式关闭 Google 照片的同步功能?如果不是,那么直接向 Google 帐户的“数据和同步”屏幕启动 Activity 以便用户手动禁用同步的正确 Intent 是什么?
提前致谢!
编辑:
我发现了一些有用的代码,但“Google-Photos”(又名 Picasa)的授权字符串是什么?
import android.provider.ContactsContract;
AccountManager am = AccountManager.get(this);
Account[] accounts = am.getAccountsByType("com.google");
boolean syncEnabled = ContentResolver.getSyncAutomatically(accounts[0], ContactsContract.AUTHORITY);
【问题讨论】:
-
有点(非常)晚了,但你试过“com.cooliris.picasa.contentprovider”吗?
-
以上代码不再适用于更高版本的 Android:am.getAccountsByType("com.google");
标签: android