/** * Creates a new UiLifecycleHelper. * * @param activity the Activity associated with the helper. If calling from a Fragment, * use {@link android.support.v4.app.Fragment#getActivity()} * @param callback the callback for Session status changes, can be null */ public UiLifecycleHelper(Activity activity, Session.StatusCallback callback) { if (activity == null) { throw new IllegalArgumentException(ACTIVITY_NULL_MESSAGE); } this.activity = activity; this.callback = callback; this.receiver = new ActiveSessionBroadcastReceiver(); this.broadcastManager = LocalBroadcastManager.getInstance(activity); this.pendingFacebookDialogCallStore = PendingCallStore.getInstance(); // initialize SDK Settings.sdkInitialize(activity); }