google api - Logout for GoogleApiClient in Android application -


using such code possible link app , use account.

if (mgoogleapiclient == null) {             mgoogleapiclient = new googleapiclient.builder(this)                     .addapi(plus.api)                     .addapi(drive.api)                     .addscope(drive.scope_file)                     .addscope(drive.scope_appfolder)                     .addconnectioncallbacks(this)                     .addonconnectionfailedlistener(this)                     .build();         }         mgoogleapiclient.connect(); 

but way 'logout' account once activated or switch new one?

i found up-to-date solution:

if (mgoogleapiclient != null && mgoogleapiclient.isconnected()) {                         mgoogleapiclient.cleardefaultaccountandreconnect().setresultcallback(new resultcallback<status>() {                              @override                             public void onresult(status status) {                                  mgoogleapiclient.disconnect();                             }                         });                      }   

the usage of

plus.accountapi.cleardefaultaccount(mgoogleapiclient); 

is deprecated

https://developers.google.com/android/reference/com/google/android/gms/plus/account


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -