是否可以在整个活动中存储电子邮件,姓名等信息。在每项活动中都会保留Google的登入信息
我知道如何在活动中收集这些信息,其中我initilazie登录按钮,但我不知道如何正确保留下一个活动。我想过把它存储在SQLlite中,但首先我想检查它是否有其他方法。
我会很高兴的任何信息。
GoogleSignInResult result = Auth.GoogleSignInApi.getSignInResultFromIntent(data);
GoogleSignInAccount acct = result.getSignInAccount();
String personName = acct.getDisplayName();
String personGivenName = acct.getGivenName();
String personFamilyName = acct.getFamilyName();
String personEmail = acct.getEmail();
String personId = acct.getId();
Uri personPhoto = acct.getPhotoUrl();
将其存储在共享首选项中。 –
你需要这个https://developer.android.com/training/basics/data-storage/shared-preferences.html – Spartan
谢谢你们,我会测试它。 – Michael