当前位置: 首页>>代码示例>>Java>>正文


Java Session.StatusCallback方法代码示例

本文整理汇总了Java中com.facebook.Session.StatusCallback方法的典型用法代码示例。如果您正苦于以下问题:Java Session.StatusCallback方法的具体用法?Java Session.StatusCallback怎么用?Java Session.StatusCallback使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.facebook.Session的用法示例。


在下文中一共展示了Session.StatusCallback方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: SessionTracker

import com.facebook.Session; //导入方法依赖的package包/类
/**
 * Constructs a SessionTracker to track the Session object passed in.
 * If the Session is null, then it will track the active Session instead.
 * 
 * @param context the context object.
 * @param callback the callback to use whenever the Session's state changes
 * @param session the Session object to track
 * @param startTracking whether to start tracking the Session right away
 */
public SessionTracker(Context context, Session.StatusCallback callback, Session session, boolean startTracking) {
    this.callback = new CallbackWrapper(callback);
    this.session = session;
    this.receiver = new ActiveSessionBroadcastReceiver();
    this.broadcastManager = LocalBroadcastManager.getInstance(context);

    if (startTracking) {
        startTracking();
    }
}
 
开发者ID:MobileDev418,项目名称:AndroidBackendlessChat,代码行数:20,代码来源:SessionTracker.java

示例2: IUiLifecycleHelperImpl

import com.facebook.Session; //导入方法依赖的package包/类
public IUiLifecycleHelperImpl(Activity activity, Session.StatusCallback statusCallback) {
    if (com.facebook.Settings.getApplicationId() != null) {
        // make this initialization only if there is an applicationId already configured

        uiLifecycleHelper = new UiLifecycleHelper(activity, statusCallback);
    }
}
 
开发者ID:edx,项目名称:edx-app-android,代码行数:8,代码来源:IUiLifecycleHelperImpl.java

示例3: onActivityCreated

import com.facebook.Session; //导入方法依赖的package包/类
@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();
        }
    }
}
 
开发者ID:yeloapp,项目名称:yelo-android,代码行数:38,代码来源:PickerFragment.java

示例4: initializeFBSession

import com.facebook.Session; //导入方法依赖的package包/类
private void initializeFBSession() {
    lifecycleHelper = new UiLifecycleHelper(this,
            new Session.StatusCallback() {
                @Override
                public void call(Session session, SessionState state,
                                 Exception exception) {
                    onSessionStateChanged(session, state, exception);
                }
            });
    lifecycleHelper.onCreate(savedInstanceState);

    ensureOpenSession();

}
 
开发者ID:3bytessolutions,项目名称:CallService-Facebook-sample,代码行数:15,代码来源:UserHome.java

示例5: CallbackWrapper

import com.facebook.Session; //导入方法依赖的package包/类
public CallbackWrapper(Session.StatusCallback wrapped) {
    this.wrapped = wrapped;
}
 
开发者ID:MobileDev418,项目名称:AndroidBackendlessChat,代码行数:4,代码来源:SessionTracker.java

示例6: onCreate

import com.facebook.Session; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    Logger.d("FragmentSocialTimeline", " onCreate");
    super.onCreate(savedInstanceState);
    if (savedInstanceState == null) {
        init();
    }

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD) {

        fbhelper = new UiLifecycleHelper(getActivity(), new Session.StatusCallback() {
            @Override
            public void call(final Session session, SessionState state, Exception exception) {
                if (!AptoideUtils.AccountUtils.isLoggedIn(Aptoide.getContext()) || removeAccount) {
                    try {
                        final AccountManager mAccountManager = AccountManager.get(getActivity());

                        if (session.isOpened()) {
                            Request.newMeRequest(session, new Request.GraphUserCallback() {
                                @Override
                                public void onCompleted(final GraphUser user, Response response) {

                                    if (removeAccount && mAccountManager.getAccountsByType(Aptoide.getConfiguration().getAccountType()).length > 0) {
                                        mAccountManager.removeAccount(mAccountManager.getAccountsByType(Aptoide.getConfiguration().getAccountType())[0], new AccountManagerCallback<Boolean>() {
                                            @Override
                                            public void run(AccountManagerFuture<Boolean> future) {
                                                startLogin(user, session);
                                            }
                                        }, new Handler(Looper.getMainLooper()));
                                    } else {

                                        startLogin(user, session);
                                    }
                                }
                            }).executeAsync();

                        }
                    } catch (Exception e) {
                        Toast.makeText(Aptoide.getContext(), R.string.error_occured, Toast.LENGTH_LONG).show();
                        loginError();
                    }
                }
            }
        });

        fbhelper.onCreate(savedInstanceState);
    }
}
 
开发者ID:Aptoide,项目名称:aptoide-client,代码行数:49,代码来源:FragmentSocialTimeline.java

示例7: getSessionStatusCallback

import com.facebook.Session; //导入方法依赖的package包/类
public Session.StatusCallback getSessionStatusCallback() {
    return sessionStatusCallback;
}
 
开发者ID:yeloapp,项目名称:yelo-android,代码行数:4,代码来源:LoginButton.java

示例8: getInstance

import com.facebook.Session; //导入方法依赖的package包/类
/**
 * Returns instance of {@link org.edx.mobile.module.facebook.IUiLifecycleHelperImpl} class.
 * @param activity
 * @param statusCallback
 * @return
 */
public static IUiLifecycleHelper getInstance(Activity activity, Session.StatusCallback statusCallback) {
    return new IUiLifecycleHelperImpl(activity, statusCallback);
}
 
开发者ID:edx,项目名称:edx-app-android,代码行数:10,代码来源:IUiLifecycleHelper.java


注:本文中的com.facebook.Session.StatusCallback方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。