【发布时间】:2020-12-12 17:44:21
【问题描述】:
在我的片段 java 类中,“this”语句中的 getLastSignedInAccount 出现错误,以下是代码:
GoogleSignedInAccount signInAccount = GoogleSignIn.getLastSignedInAccount(this);
if(signInAccount != null){
name.setText(signInAccount.getDisplayName());
mail.setText(signInAccount.getEmail());
}
【问题讨论】:
-
欢迎来到stackoverflow。请通过此链接一次。 stackoverflow.com/help/how-to-ask
-
方法定义为
#getLastSignedInAccount(Context context)。你已经通过了 context 。在片段中,您可以使用getContext()来使用上下文。
标签: android google-signin