Delay android PlusClient login request

Posted by jamesakadamingo on Stack Overflow See other posts from Stack Overflow or by jamesakadamingo
Published on 2012-10-06T13:54:25Z Indexed on 2012/10/11 21:37 UTC
Read the original article Hit count: 159

I am trying to implement the new PlayServices API within my android application to use a +1 button.

I have it working nicely, all the expected functionality is there. However it has one rather annoying feature (seriously google!). When you instance the plusclient:

mPlusClient = new PlusClient(this, this, this, Scopes.PLUS_PROFILE);

Your user is presented with a "Pick your account" dialog (if they have more than one account) followed by a "grant access" dialog. I understand the need for these steps, however they really get in the way of the user experience!

My initial activity (post splash screen) now has the +1 button, which means that you have to instance the PlusClient. Doing so in the onCreate() method (as google suggests) means that my user is given the "authorisation" screen before they even know what is going on!

What I want to do it delay that untill they actually click the +1 button. That way they will know why they are being asked to authorise access to their account!

Any ideas? I have tried using an onClick listener on the +1 button to instance but it didn't work.

© Stack Overflow or respective owner

Related posts about android

Related posts about google-plus-one