Search in sources :

Example 6 with SessionTracker

use of com.facebook.internal.SessionTracker in project phonegap-facebook-plugin by Wizcorp.

the class PickerFragment method onActivityCreated.

@Override
public void onActivityCreated(final Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    sessionTracker = new SessionTracker(getActivity(), new Session.StatusCallback() {

        @Override
        public void call(Session session, SessionState state, Exception exception) {
            if (!session.isOpened()) {
                // When a session is closed, we want to clear out our data so it is not visible to subsequent users
                clearResults();
            }
        }
    });
    setSettingsFromBundle(savedInstanceState);
    loadingStrategy = createLoadingStrategy();
    loadingStrategy.attach(adapter);
    selectionStrategy = createSelectionStrategy();
    selectionStrategy.readSelectionFromBundle(savedInstanceState, SELECTION_BUNDLE_KEY);
    // Should we display a title bar? (We need to do this after we've retrieved our bundle settings.)
    if (showTitleBar) {
        inflateTitleBar((ViewGroup) getView());
    }
    if (activityCircle != null && savedInstanceState != null) {
        boolean shown = savedInstanceState.getBoolean(ACTIVITY_CIRCLE_SHOW_KEY, false);
        if (shown) {
            displayActivityCircle();
        } else {
            // Should be hidden already, but just to be sure.
            hideActivityCircle();
        }
    }
}
Also used : SessionState(com.facebook.SessionState) SessionTracker(com.facebook.internal.SessionTracker) FacebookException(com.facebook.FacebookException) Session(com.facebook.Session)

Example 7 with SessionTracker

use of com.facebook.internal.SessionTracker in project Klyph by jonathangerbaud.

the class PickerFragment method onActivityCreated.

@Override
public void onActivityCreated(final Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    sessionTracker = new SessionTracker(getActivity(), new Session.StatusCallback() {

        @Override
        public void call(Session session, SessionState state, Exception exception) {
            if (!session.isOpened()) {
                // When a session is closed, we want to clear out our data so it is not visible to subsequent users
                clearResults();
            }
        }
    });
    setSettingsFromBundle(savedInstanceState);
    loadingStrategy = createLoadingStrategy();
    loadingStrategy.attach(adapter);
    selectionStrategy = createSelectionStrategy();
    selectionStrategy.readSelectionFromBundle(savedInstanceState, SELECTION_BUNDLE_KEY);
    // Should we display a title bar? (We need to do this after we've retrieved our bundle settings.)
    if (showTitleBar) {
        inflateTitleBar((ViewGroup) getView());
    }
    if (activityCircle != null && savedInstanceState != null) {
        boolean shown = savedInstanceState.getBoolean(ACTIVITY_CIRCLE_SHOW_KEY, false);
        if (shown) {
            displayActivityCircle();
        } else {
            // Should be hidden already, but just to be sure.
            hideActivityCircle();
        }
    }
}
Also used : SessionTracker(com.facebook.internal.SessionTracker)

Example 8 with SessionTracker

use of com.facebook.internal.SessionTracker in project facebook-api-android-maven by avianey.

the class LoginButton method finishInit.

private void finishInit() {
    super.setOnClickListener(new LoginClickListener());
    setButtonText();
    if (!isInEditMode()) {
        sessionTracker = new SessionTracker(getContext(), new LoginButtonCallback(), null, false);
        fetchUserInfo();
    }
}
Also used : SessionTracker(com.facebook.internal.SessionTracker)

Example 9 with SessionTracker

use of com.facebook.internal.SessionTracker in project facebook-api-android-maven by avianey.

the class PickerFragment method onActivityCreated.

@Override
public void onActivityCreated(final Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    sessionTracker = new SessionTracker(getActivity(), new Session.StatusCallback() {

        @Override
        public void call(Session session, SessionState state, Exception exception) {
            if (!session.isOpened()) {
                // When a session is closed, we want to clear out our data so it is not visible to subsequent users
                clearResults();
            }
        }
    });
    setSettingsFromBundle(savedInstanceState);
    loadingStrategy = createLoadingStrategy();
    loadingStrategy.attach(adapter);
    selectionStrategy = createSelectionStrategy();
    selectionStrategy.readSelectionFromBundle(savedInstanceState, SELECTION_BUNDLE_KEY);
    // Should we display a title bar? (We need to do this after we've retrieved our bundle settings.)
    if (showTitleBar) {
        inflateTitleBar((ViewGroup) getView());
    }
    if (activityCircle != null && savedInstanceState != null) {
        boolean shown = savedInstanceState.getBoolean(ACTIVITY_CIRCLE_SHOW_KEY, false);
        if (shown) {
            displayActivityCircle();
        } else {
            // Should be hidden already, but just to be sure.
            hideActivityCircle();
        }
    }
}
Also used : SessionState(com.facebook.SessionState) SessionTracker(com.facebook.internal.SessionTracker) FacebookException(com.facebook.FacebookException) Session(com.facebook.Session)

Example 10 with SessionTracker

use of com.facebook.internal.SessionTracker in project phonegap-facebook-plugin by Wizcorp.

the class LoginButton method finishInit.

private void finishInit() {
    super.setOnClickListener(new LoginClickListener());
    setButtonText();
    if (!isInEditMode()) {
        sessionTracker = new SessionTracker(getContext(), new LoginButtonCallback(), null, false);
        fetchUserInfo();
    }
}
Also used : SessionTracker(com.facebook.internal.SessionTracker)

Aggregations

SessionTracker (com.facebook.internal.SessionTracker)12 FacebookException (com.facebook.FacebookException)2 Session (com.facebook.Session)2 SessionState (com.facebook.SessionState)2