use of com.facebook.AccessTokenTracker in project facebook-android-sdk by facebook.
the class UserSettingsFragment method onActivityCreated.
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
accessTokenTracker = new AccessTokenTracker() {
@Override
protected void onCurrentAccessTokenChanged(AccessToken oldAccessToken, AccessToken currentAccessToken) {
fetchUserInfo();
updateUI();
}
};
callbackManager = CallbackManager.Factory.create();
}
use of com.facebook.AccessTokenTracker in project facebook-android-sdk by facebook.
the class ProfileFragment method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setHasOptionsMenu(true);
callbackManager = CallbackManager.Factory.create();
profileTracker = new ProfileTracker() {
@Override
protected void onCurrentProfileChanged(Profile oldProfile, Profile currentProfile) {
setProfile(currentProfile);
}
};
accessTokenTracker = new AccessTokenTracker() {
@Override
protected void onCurrentAccessTokenChanged(AccessToken oldAccessToken, AccessToken currentAccessToken) {
// On AccessToken changes fetch the new profile which fires the event on
// the ProfileTracker if the profile is different
Profile.fetchProfileForCurrentAccessToken();
}
};
// Ensure that our profile is up to date
Profile.fetchProfileForCurrentAccessToken();
setProfile(Profile.getCurrentProfile());
}
Aggregations