android - 如何触发客户经理从应用程序添加新帐户

标签 android account-management

我正在尝试扩展 SampleSync应用。安装该应用程序后,我可以转到设置->帐户和同步->添加帐户以添加帐户。但是,如果我想从我的应用程序代码中检查并希望触发 AccountManager 直接添加新帐户,最好的方法应该是什么?

最佳答案

好吧,我终于搞定了,

您实际上可以激活 AccountManager 来添加一个帐户:

final AccountManager accountMgr = AccountManager.get(Main.this);
accountMgr.addAccount(Constants.ACCOUNT_TYPE, Constants.AUTHTOKEN_TYPE, null, null, Main.this, null, null);

关于android - 如何触发客户经理从应用程序添加新帐户,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4406590/

相关文章:

c# - 使用 C# System.DirectoryServices 在远程 Windows 服务器上进行用户管理

java - 将 RGB 转换为位图中的 X 和 Y

android - 是否可以在 MapActivity 中使用 Loaders 类?

java - 在android中构建自动刷新方法

c#-4.0 - GroupPrincipal 抛出 "System.Runtime.InteropServices.COMException (0x8007200A): The specified directory service attribute or value does not exist."

active-directory - 使用 PrincipalSearcher 搜索多个用户

c# - UserPrincipal.FindByIdentity 抛出PrincipalServerDownException

javascript - 如何创建 android webview 将我的位置共享到网站?

android - 从服务器 RPC :s-7:AEC-0 in Google play? 检索信息时出错