Here I am trying to clear the values even if the session is true. So I am thinking of clearing the session. Below is what I am trying.
public boolean isSession() {
sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context);
String access_token = sharedPrefs.getString("access_token", "x");
Long expires = sharedPrefs.getLong("access_expires", -1);
if (access_token != null && expires != -1) {
facebook.setAccessToken(access_token);
facebook.setAccessExpires(expires);
}
return facebook.isSessionValid();
How do I clear the session here so that it returns false when I check the following?
public void getID() {
if (isSession()) {
}
}
facebook.setAccessExpires(-1);facebook.setAccessToken(null);And then call
isSessionValid()