java - How do I make signOut Google+ in onNavigationItemSelected -


i'm doing sign in google+ leads navigation.activity. ive follow instruction on google developer took signin method(success) im stuck @ navigation.activity. how make logout navigationitemselected?

what problem : google plus signin in main activity need logout navigation activity...

ty helping

  else if (id == r.id.logout) {    } 

this onresult

@override             public void onresult(googlesigninresult googlesigninresult) {                 hideprogressdialog();                 handlesigninresult(googlesigninresult);             } 

it call hideprogress , handlesigninresult method..

private void handlesigninresult(googlesigninresult result) {     log.d(tag, "handlesigninresult:" + result.issuccess());     if (result.issuccess()) {         // signed in successfully, show authenticated ui.         intent intent = new intent(main.this,homeactivity.class);         startactivity(intent);     } else {         // signed out     } }    private void hideprogressdialog() {     if (mprogressdialog != null && mprogressdialog.isshowing()) {         mprogressdialog.hide();     } } 

you can visit signing out users , disconnecting accounts official link perform signout , revoke access operation
singout

private void signout() {     auth.googlesigninapi.signout(mgoogleapiclient).setresultcallback(             new resultcallback<status>() {                 @override                 public void onresult(status status) {                     // ...                 }             }); } 


disconnect account

private void revokeaccess() {     auth.googlesigninapi.revokeaccess(mgoogleapiclient).setresultcallback(             new resultcallback<status>() {                 @override                 public void onresult(status status) {                     // ...                 }             }); } 

happycoding;


Comments

Popular posts from this blog

Django REST Framework perform_create: You cannot call `.save()` after accessing `serializer.data` -

Why does Go error when trying to marshal this JSON? -