@Override public void onDestroy() { super.onDestroy(); profileTracker.stopTracking(); }
/** * Starts tracking the current profile. */ public void startTracking() { if (isTracking) { return; } addBroadcastReceiver(); isTracking = true; }
@Override public void onReceive(Context context, Intent intent) { if (ProfileManager.ACTION_CURRENT_PROFILE_CHANGED.equals(intent.getAction())) { Profile oldProfile = intent.getParcelableExtra(ProfileManager.EXTRA_OLD_PROFILE); Profile newProfile = intent.getParcelableExtra(ProfileManager.EXTRA_NEW_PROFILE); onCurrentProfileChanged(oldProfile, newProfile); } } }
/** * Constructor. */ public ProfileTracker() { Validate.sdkInitialized(); this.receiver = new ProfileBroadcastReceiver(); this.broadcastManager = LocalBroadcastManager.getInstance( FacebookSdk.getApplicationContext()); startTracking(); }
@Override public void onDestroy() { super.onDestroy(); profileTracker.stopTracking(); accessTokenTracker.stopTracking(); }
@Override protected void onDestroy() { super.onDestroy(); profileTracker.stopTracking(); LoginManager.getInstance().unregisterCallback(callbackManager); }
} finally { if (tracker != null) { tracker.stopTracking();
public void onDestroy() { mAccessTokenTracker.stopTracking(); mProfileTracker.stopTracking(); }