I am writing an app which requires user login.
I would like to implement it by Google+ and have followed the following articles to set-up my login activity Log
Connect a GoogleApiClient in your MainActivity as normal, but in the onConnectionFailed instead of storing the result or resolving the error enable the sign in button. When the user clicks that, start your LoginActivity, which should also implement GoogleApiClient and related interfaces, and do all of your ConnectionResult handling from there.
You might find it easier if you create a base activity that does the GoogleApiClient setup that both your activities implement. It's totally fine to have the GoogleApiClient connection started on each activity - its designed to be used that way.