本文整理汇总了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;
}
}
}
示例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;
}
}