本文整理汇总了Java中com.facebook.widget.FacebookDialog.handleActivityResult方法的典型用法代码示例。如果您正苦于以下问题:Java FacebookDialog.handleActivityResult方法的具体用法?Java FacebookDialog.handleActivityResult怎么用?Java FacebookDialog.handleActivityResult使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.facebook.widget.FacebookDialog
的用法示例。
在下文中一共展示了FacebookDialog.handleActivityResult方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: cancelPendingAppCall
import com.facebook.widget.FacebookDialog; //导入方法依赖的package包/类
private void cancelPendingAppCall(FacebookDialog.Callback facebookDialogCallback) {
if (facebookDialogCallback != null) {
Intent pendingIntent = pendingFacebookDialogCall.getRequestIntent();
Intent cancelIntent = new Intent();
cancelIntent.putExtra(NativeProtocol.EXTRA_PROTOCOL_CALL_ID,
pendingIntent.getStringExtra(NativeProtocol.EXTRA_PROTOCOL_CALL_ID));
cancelIntent.putExtra(NativeProtocol.EXTRA_PROTOCOL_ACTION,
pendingIntent.getStringExtra(NativeProtocol.EXTRA_PROTOCOL_ACTION));
cancelIntent.putExtra(NativeProtocol.EXTRA_PROTOCOL_VERSION,
pendingIntent.getIntExtra(NativeProtocol.EXTRA_PROTOCOL_VERSION, 0));
cancelIntent.putExtra(NativeProtocol.STATUS_ERROR_TYPE, NativeProtocol.ERROR_UNKNOWN_ERROR);
FacebookDialog.handleActivityResult(activity, pendingFacebookDialogCall,
pendingFacebookDialogCall.getRequestCode(), cancelIntent, facebookDialogCallback);
}
pendingFacebookDialogCall = null;
}
示例2: onActivityResult
import com.facebook.widget.FacebookDialog; //导入方法依赖的package包/类
private boolean onActivityResult(int requestCode, int resultCode, Intent data, UUID callId) {
if (pendingCallId == null || !pendingCallId.equals(callId)) {
return false;
}
// See if we were waiting for a dialog completion
FacebookDialog.PendingCall pendingCall = PendingCallStore.getInstance().getPendingCallById(pendingCallId);
if (pendingCall == null) {
return false;
}
// Look for results
FacebookDialog.handleActivityResult(
context,
pendingCall,
requestCode,
data,
getFacebookDialogCallback(pendingCallAnalyticsBundle));
// The handlers from above will run synchronously. So by the time we get here, it should be safe to
// stop tracking this call and also serialize the controller to disk
stopTrackingPendingCall();
return true;
}
示例3: onActivityResult
import com.facebook.widget.FacebookDialog; //导入方法依赖的package包/类
private boolean onActivityResult(int requestCode, int resultCode, Intent data, UUID callId) {
if (pendingCallId == null || !pendingCallId.equals(callId)) {
return false;
}
// See if we were waiting for a dialog completion
FacebookDialog.PendingCall pendingCall = PendingCallStore.getInstance().getPendingCallById(pendingCallId);
if (pendingCall == null) {
return false;
}
// Look for results
FacebookDialog.handleActivityResult(
applicationContext,
pendingCall,
requestCode,
data,
getFacebookDialogCallback(pendingCallAnalyticsBundle));
// The handlers from above will run synchronously. So by the time we get here, it should be safe to
// stop tracking this call and also serialize the controller to disk
stopTrackingPendingCall();
return true;
}
示例4: handleFacebookDialogActivityResult
import com.facebook.widget.FacebookDialog; //导入方法依赖的package包/类
private boolean handleFacebookDialogActivityResult(int paramInt1, int paramInt2, Intent paramIntent, FacebookDialog.Callback paramCallback)
{
if ((this.pendingFacebookDialogCall == null) || (this.pendingFacebookDialogCall.getRequestCode() != paramInt1))
return false;
if (paramIntent == null)
{
cancelPendingAppCall(paramCallback);
return true;
}
String str = paramIntent.getStringExtra("com.facebook.platform.protocol.CALL_ID");
UUID localUUID = null;
if (str != null);
try
{
localUUID = UUID.fromString(str);
}
catch (IllegalArgumentException localIllegalArgumentException)
{
}
if ((localUUID != null) && (this.pendingFacebookDialogCall.getCallId().equals(localUUID)))
FacebookDialog.handleActivityResult(this.activity, this.pendingFacebookDialogCall, paramInt1, paramIntent, paramCallback);
else
cancelPendingAppCall(paramCallback);
this.pendingFacebookDialogCall = null;
return true;
}
示例5: handleFacebookDialogActivityResult
import com.facebook.widget.FacebookDialog; //导入方法依赖的package包/类
private boolean handleFacebookDialogActivityResult(int requestCode, int resultCode, Intent data,
FacebookDialog.Callback facebookDialogCallback) {
if (pendingFacebookDialogCall == null || pendingFacebookDialogCall.getRequestCode() != requestCode) {
return false;
}
if (data == null) {
// We understand the request code, but have no Intent. This can happen if the called Activity crashes
// before it can be started; we treat this as a cancellation because we have no other information.
cancelPendingAppCall(facebookDialogCallback);
return true;
}
String callIdString = data.getStringExtra(NativeProtocol.EXTRA_PROTOCOL_CALL_ID);
UUID callId = null;
if (callIdString != null) {
try {
callId = UUID.fromString(callIdString);
} catch (IllegalArgumentException exception) {
}
}
// Was this result for the call we are waiting on?
if (callId != null && pendingFacebookDialogCall.getCallId().equals(callId)) {
// Yes, we can handle it normally.
FacebookDialog.handleActivityResult(activity, pendingFacebookDialogCall, requestCode, data,
facebookDialogCallback);
} else {
// No, send a cancellation error to the pending call and ignore the result, because we
// don't know what to do with it.
cancelPendingAppCall(facebookDialogCallback);
}
pendingFacebookDialogCall = null;
return true;
}
示例6: handleFacebookDialogActivityResult
import com.facebook.widget.FacebookDialog; //导入方法依赖的package包/类
private boolean handleFacebookDialogActivityResult(int requestCode, int resultCode, Intent data,
FacebookDialog.Callback facebookDialogCallback) {
if (pendingFacebookDialogCallId == null) {
return false;
}
FacebookDialog.PendingCall pendingCall =
pendingFacebookDialogCallStore.getPendingCallById(pendingFacebookDialogCallId);
if (pendingCall == null || pendingCall.getRequestCode() != requestCode) {
return false;
}
if (data == null) {
// We understand the request code, but have no Intent. This can happen if the called Activity crashes
// before it can be started; we treat this as a cancellation because we have no other information.
cancelPendingAppCall(facebookDialogCallback);
return true;
}
UUID callId = NativeProtocol.getCallIdFromIntent(data);
// Was this result for the call we are waiting on?
if (callId != null && pendingFacebookDialogCallId.equals(callId)) {
// Yes, we can handle it normally.
FacebookDialog.handleActivityResult(activity, pendingCall, requestCode, data,
facebookDialogCallback);
} else {
// No, send a cancellation error to the pending call and ignore the result, because we
// don't know what to do with it.
cancelPendingAppCall(facebookDialogCallback);
}
stopTrackingPendingAppCall();
return true;
}
示例7: cancelPendingAppCall
import com.facebook.widget.FacebookDialog; //导入方法依赖的package包/类
private void cancelPendingAppCall(FacebookDialog.Callback facebookDialogCallback) {
if (pendingFacebookDialogCallId == null) {
return;
}
FacebookDialog.PendingCall pendingCall =
pendingFacebookDialogCallStore.getPendingCallById(pendingFacebookDialogCallId);
if (pendingCall == null) {
return;
}
if (facebookDialogCallback != null) {
Intent pendingIntent = pendingCall.getRequestIntent();
Intent cancelIntent = new Intent();
cancelIntent.putExtra(NativeProtocol.EXTRA_PROTOCOL_CALL_ID,
pendingIntent.getStringExtra(NativeProtocol.EXTRA_PROTOCOL_CALL_ID));
cancelIntent.putExtra(NativeProtocol.EXTRA_PROTOCOL_ACTION,
pendingIntent.getStringExtra(NativeProtocol.EXTRA_PROTOCOL_ACTION));
cancelIntent.putExtra(NativeProtocol.EXTRA_PROTOCOL_VERSION,
pendingIntent.getIntExtra(NativeProtocol.EXTRA_PROTOCOL_VERSION, 0));
cancelIntent.putExtra(NativeProtocol.STATUS_ERROR_TYPE, NativeProtocol.ERROR_UNKNOWN_ERROR);
FacebookDialog.handleActivityResult(activity, pendingCall,
pendingCall.getRequestCode(), cancelIntent, facebookDialogCallback);
}
stopTrackingPendingAppCall();
}
示例8: handleFacebookDialogActivityResult
import com.facebook.widget.FacebookDialog; //导入方法依赖的package包/类
private boolean handleFacebookDialogActivityResult(int requestCode, int resultCode, Intent data,
FacebookDialog.Callback facebookDialogCallback) {
if (pendingFacebookDialogCall == null || pendingFacebookDialogCall.getRequestCode() != requestCode) {
return false;
}
if (data == null) {
// We understand the request code, but have no Intent. This can happen if the called Activity crashes
// before it can be started; we treat this as a cancellation because we have no other information.
cancelPendingAppCall(facebookDialogCallback);
return true;
}
UUID callId = NativeProtocol.getCallIdFromIntent(data);
// Was this result for the call we are waiting on?
if (callId != null && pendingFacebookDialogCall.getCallId().equals(callId)) {
// Yes, we can handle it normally.
FacebookDialog.handleActivityResult(activity, pendingFacebookDialogCall, requestCode, data,
facebookDialogCallback);
} else {
// No, send a cancellation error to the pending call and ignore the result, because we
// don't know what to do with it.
cancelPendingAppCall(facebookDialogCallback);
}
pendingFacebookDialogCall = null;
return true;
}