I am using the facebook sdk 4.3.0 , now i have case if user is not login (in case of my app first run or log out) it should show login activity , other wise it should show other activity .
Now what I am doing is getting the info through this my own made method
if (isLoggedIn()) {
Show Fragment A
} else {
FbLogin fbLogin = new FbLogin();
fragmentTransaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_CLOSE);
fragmentTransaction.add(R.id.frame, fbLogin, "FbLogin").commit();
}
and this is how I am getting the login confirmation
public boolean isLoggedIn() {
AccessToken accessToken = AccessToken.getCurrentAccessToken();
if(accessToken.isExpired()){
return false;
}else{
return true;
}
}
but some how I came to know that it is not telling me that if the user's Accesstoken is really expired or not. So please tell me that how to check if the user Accesstoken is expired or not