Google api gettoken(Context,String,String)现已弃用

时间:2016-06-15 11:51:28

标签: android google-api google-plus google-signin

我曾经使用GoogleAuthUtil.gettoken(Context,String,String)方法获取访问令牌。现在它已被弃用,我想要一个替代方案。我认为它现在需要Account作为参数类型,但我真的不知道它是如何工作的。 任何帮助将不胜感激。 谢谢。

1 个答案:

答案 0 :(得分:1)

您可以通过电子邮件地址创建帐户:

Account account = new Account(email,  GoogleAuthUtil.GOOGLE_ACCOUNT_TYPE);