Search code examples
android-intentandroid-fragmentsbundlegoogle-fit

How to pass a instance of a google api connected client


I am suffering from a bit of confusion around the google fit and google + api. When my app is first opened the user is asked to sign in with google + etc and then, if they are logged in, are transfered via intent to my home class. This class sets up some fragments for the user profile area.

The bit I am confused about is how to recall this client from a fragment later on? As far as I am aware you cannot transfer the client instace in a bundle? Is it a case that I would have to run my who login bit again to retrieve the client, obviously as they have already approved my app it should just happen automatically or am I missing something?


Solution

  • I solved this by using a Subclass application, thanks to this post : Pass connection object to other activity - Google Tasks API