简体   繁体   中英

Displaying google+ username after sign-in

I followed Google's tutorial on implementing the google+ api but it doesn't say anything about that dialog with the user's name that shows up at the top of your screen after signing in to your google+ account like many other games have. I can't find any information about different layouts either, like the loading screen that shows up sometimes after you've pressed sign-in.

You can use the API to request the users profile:

Person me = Plus.PeopleApi.getCurrentPerson(mGoogleApiClient);
if (me != null) {
    //me.getDisplayName();
}

It seems like what is displayed during the login process really depends on the speed of the device, the load on the device, and perhaps the network connection. In my case, most of the time the activity starts and disappears before I have a chance to read what it says (when user has already been authorized).

I think you can always count on your activity being paused then resumed if you call mGoogleApiClient.connect() when !mGoogleApiClient.isConnected(). I do not believe you can brand their Activity other than with your application logo.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM