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


Java Session.onActivityResult方法代码示例

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


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

示例1: authorizeCallback

import com.facebook.Session; //导入方法依赖的package包/类
/**
 * IMPORTANT: If you are using the deprecated authorize() method,
 * this method must be invoked at the top of the calling
 * activity's onActivityResult() function or Facebook authentication will
 * not function properly!
 * <p/>
 * If your calling activity does not currently implement onActivityResult(),
 * you must implement it and include a call to this method if you intend to
 * use the authorize() method in this SDK.
 * <p/>
 * For more information, see
 * http://developer.android.com/reference/android/app/
 * Activity.html#onActivityResult(int, int, android.content.Intent)
 * <p/>
 * This method is deprecated.  See {@link com.facebook.android.Facebook} and {@link Session} for more info.
 */
@Deprecated
public void authorizeCallback(int requestCode, int resultCode, Intent data) {
    checkUserSession("authorizeCallback");
    Session pending = this.pendingOpeningSession;
    if (pending != null) {
        if (pending.onActivityResult(this.pendingAuthorizationActivity, requestCode, resultCode, data)) {
            this.pendingOpeningSession = null;
            this.pendingAuthorizationActivity = null;
            this.pendingAuthorizationPermissions = null;
        }
    }
}
 
开发者ID:yeloapp,项目名称:yelo-android,代码行数:29,代码来源:Facebook.java

示例2: onActivityResult

import com.facebook.Session; //导入方法依赖的package包/类
/**
 * Provides an implementation for {@link Activity#onActivityResult
 * onActivityResult} that updates the Session based on information returned
 * during the authorization flow. The Activity containing this view
 * should forward the resulting onActivityResult call here to
 * update the Session state based on the contents of the resultCode and
 * data.
 *
 * @param requestCode
 *            The requestCode parameter from the forwarded call. When this
 *            onActivityResult occurs as part of Facebook authorization
 *            flow, this value is the activityCode passed to open or
 *            authorize.
 * @param resultCode
 *            An int containing the resultCode parameter from the forwarded
 *            call.
 * @param data
 *            The Intent passed as the data parameter from the forwarded
 *            call.
 * @return A boolean indicating whether the requestCode matched a pending
 *         authorization request for this Session.
 * @see Session#onActivityResult(Activity, int, int, Intent)
 */
public boolean onActivityResult(int requestCode, int resultCode, Intent data) {
    Session session = sessionTracker.getSession();
    if (session != null) {
        return session.onActivityResult((Activity)getContext(), requestCode,
                resultCode, data);
    } else {
        return false;
    }
}
 
开发者ID:yeloapp,项目名称:yelo-android,代码行数:33,代码来源:LoginButton.java


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