File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed
src/AndroidClient/androidchat/src/main/java/servicestack/net/androidchat Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -89,6 +89,18 @@ public void saveTwitterAccessToken(TwitterAuthToken authToken){
8989 editor .putString ("twitter.AccessTokenSecret" , authToken .secret );
9090 editor .apply ();
9191 }
92+
93+ public void logout (){
94+ App .get ().getServiceClient ().clearCookies (); //Logout server
95+
96+ LoginManager .getInstance ().logOut (); //Logout facebook
97+
98+ SharedPreferences .Editor editor = prefs .edit (); //Logout twitter
99+ editor .remove ("twitter.AccessToken" );
100+ editor .remove ("twitter.AccessTokenSecret" );
101+ editor .apply ();
102+ }
103+
92104 public void readBitmap (final String url , final AsyncSuccess <Bitmap > success ){
93105 Bitmap cachedBitmap = (Bitmap )bitmapCache .get (url );
94106 if (cachedBitmap != null ){
Original file line number Diff line number Diff line change @@ -202,11 +202,9 @@ else if (Objects.equals(selector, "logout")){
202202 }
203203
204204 private void performLogout () {
205- LoginManager .getInstance ().logOut ();
206- App .get ().getServiceClient ().clearCookies ();
205+ App .get ().logout ();
207206 Intent intent = new Intent (getBaseContext (), LoginActivity .class );
208207 intent .addFlags (Intent .FLAG_ACTIVITY_CLEAR_TOP | Intent .FLAG_ACTIVITY_NEW_TASK );
209-
210208 startActivity (intent );
211209 finish ();
212210 }
You can’t perform that action at this time.
0 commit comments