【发布时间】:2012-09-11 12:04:55
【问题描述】:
在 android 中有一个 emial 应用程序允许添加电子邮件帐户。如何以编程方式在该应用程序中添加 gmail 帐户?
我使用了这个链接Add account automatically 但是 得到 SecurityException "caller uid 10040 is different than the authenticator's uid"。
我使用了那个代码
Account account = new Account("my id@gmail.com", "com.example.addaccount.account");
其中“com.example.addaccount.account”是我的应用程序的包名,我在名为 xml 的文件夹中添加了authenticator.xml 文件,包名相同 android:accountType="com.example.addaccount.account" .
但我收到错误消息“调用者 uid 10043 与验证者的 uid 不同”。谁能告诉我,我错过了什么?我刚刚添加了 xml 文件并编写了该代码来添加帐户,我是否需要以某种方式引用该 xml?
【问题讨论】:
标签: android gmail accountmanager google-account