Java 类com.facebook.internal.CallbackManagerImpl 实例源码

项目:kognitivo    文件:ShareInternalUtility.java   
public static void registerStaticShareCallback(
        final int requestCode) {
    CallbackManagerImpl.registerStaticCallback(
            requestCode,
            new CallbackManagerImpl.Callback() {
                @Override
                public boolean onActivityResult(int resultCode, Intent data) {
                    return handleActivityResult(
                            requestCode,
                            resultCode,
                            data,
                            getShareResultProcessor(null));
                }
            }
    );
}
项目:kognitivo    文件:ShareInternalUtility.java   
public static void registerSharerCallback(
        final int requestCode,
        final CallbackManager callbackManager,
        final FacebookCallback<Sharer.Result> callback) {
    if (!(callbackManager instanceof CallbackManagerImpl)) {
        throw new FacebookException("Unexpected CallbackManager, " +
                "please use the provided Factory.");
    }

    ((CallbackManagerImpl) callbackManager).registerCallback(
            requestCode,
            new CallbackManagerImpl.Callback() {
                @Override
                public boolean onActivityResult(int resultCode, Intent data) {
                    return handleActivityResult(
                            requestCode,
                            resultCode,
                            data,
                            getShareResultProcessor(callback));
                }
            });
}
项目:kognitivo    文件:JoinAppGroupDialog.java   
@Override
protected void registerCallbackImpl (
        final CallbackManagerImpl callbackManager,
        final FacebookCallback<Result> callback) {
    final ResultProcessor resultProcessor = (callback == null)
            ? null
            : new ResultProcessor(callback) {
        @Override
        public void onSuccess(AppCall appCall, Bundle results) {
            callback.onSuccess(new Result(results));
        }
    };

    CallbackManagerImpl.Callback callbackManagerCallback = new CallbackManagerImpl.Callback() {
        @Override
        public boolean onActivityResult(int resultCode, Intent data) {
            return ShareInternalUtility.handleActivityResult(
                    getRequestCode(),
                    resultCode,
                    data,
                    resultProcessor);
        }
    };

    callbackManager.registerCallback(getRequestCode(), callbackManagerCallback);
}
项目:kognitivo    文件:CreateAppGroupDialog.java   
@Override
protected void registerCallbackImpl(
        final CallbackManagerImpl callbackManager,
        final FacebookCallback<Result> callback) {
    final ResultProcessor resultProcessor = (callback == null)
            ? null
            : new ResultProcessor(callback) {
        @Override
        public void onSuccess(AppCall appCall, Bundle results) {
            callback.onSuccess(new Result(results.getString("id")));
        }
    };

    CallbackManagerImpl.Callback callbackManagerCallback = new CallbackManagerImpl.Callback() {
        @Override
        public boolean onActivityResult(int resultCode, Intent data) {
            return ShareInternalUtility.handleActivityResult(
                    getRequestCode(),
                    resultCode,
                    data,
                    resultProcessor);
        }
    };

    callbackManager.registerCallback(getRequestCode(), callbackManagerCallback);
}
项目:kognitivo    文件:LoginManager.java   
/**
 * Registers a login callback to the given callback manager.
 * @param callbackManager The callback manager that will encapsulate the callback.
 * @param callback The login callback that will be called on login completion.
 */
public void registerCallback(
        final CallbackManager callbackManager,
        final FacebookCallback<LoginResult> callback) {
    if (!(callbackManager instanceof CallbackManagerImpl)) {
        throw new FacebookException("Unexpected CallbackManager, " +
                "please use the provided Factory.");
    }
    ((CallbackManagerImpl) callbackManager).registerCallback(
            CallbackManagerImpl.RequestCodeOffset.Login.toRequestCode(),
            new CallbackManagerImpl.Callback() {
                @Override
                public boolean onActivityResult(int resultCode, Intent data) {
                    return LoginManager.this.onActivityResult(
                            resultCode,
                            data,
                            callback);
                }
            }
    );
}
项目:purple-05    文件:HomeActivity.java   
protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
    super.onActivityResult(requestCode, resultCode, intent);

    if (resultCode == -1 && requestCode == PickImageActivity.PICKER_REQUEST_CODE) {
        //가지고 온 이미지들을 이용하여 CardNews 객체 생성.
        CardNewsItem item = new CardNewsItem(this.getIntent().getStringExtra("from"), intent.getExtras().getStringArrayList(PickImageActivity.KEY_DATA_RESULT),headLine);
        cardNewsList.add(item);
        adapter.notifyDataSetChanged();
    }

    if (requestCode == CallbackManagerImpl.RequestCodeOffset.Share.toRequestCode()) {
        callbackManager.onActivityResult(requestCode, resultCode, intent);
    }


}
项目:Move-Alarm_ORCA    文件:ShareInternalUtility.java   
public static void registerStaticShareCallback(
        final int requestCode) {
    CallbackManagerImpl.registerStaticCallback(
            requestCode,
            new CallbackManagerImpl.Callback() {
                @Override
                public boolean onActivityResult(int resultCode, Intent data) {
                    return handleActivityResult(
                            requestCode,
                            resultCode,
                            data,
                            getShareResultProcessor(null));
                }
            }
    );
}
项目:Move-Alarm_ORCA    文件:ShareInternalUtility.java   
public static void registerSharerCallback(
        final int requestCode,
        final CallbackManager callbackManager,
        final FacebookCallback<Sharer.Result> callback) {
    if (!(callbackManager instanceof CallbackManagerImpl)) {
        throw new FacebookException("Unexpected CallbackManager, " +
                "please use the provided Factory.");
    }

    ((CallbackManagerImpl) callbackManager).registerCallback(
            requestCode,
            new CallbackManagerImpl.Callback() {
                @Override
                public boolean onActivityResult(int resultCode, Intent data) {
                    return handleActivityResult(
                            requestCode,
                            resultCode,
                            data,
                            getShareResultProcessor(callback));
                }
            });
}
项目:Move-Alarm_ORCA    文件:JoinAppGroupDialog.java   
@Override
protected void registerCallbackImpl (
        final CallbackManagerImpl callbackManager,
        final FacebookCallback<Result> callback) {
    final ResultProcessor resultProcessor = (callback == null)
            ? null
            : new ResultProcessor(callback) {
        @Override
        public void onSuccess(AppCall appCall, Bundle results) {
            callback.onSuccess(new Result(results));
        }
    };

    CallbackManagerImpl.Callback callbackManagerCallback = new CallbackManagerImpl.Callback() {
        @Override
        public boolean onActivityResult(int resultCode, Intent data) {
            return ShareInternalUtility.handleActivityResult(
                    getRequestCode(),
                    resultCode,
                    data,
                    resultProcessor);
        }
    };

    callbackManager.registerCallback(getRequestCode(), callbackManagerCallback);
}
项目:Move-Alarm_ORCA    文件:CreateAppGroupDialog.java   
@Override
protected void registerCallbackImpl(
        final CallbackManagerImpl callbackManager,
        final FacebookCallback<Result> callback) {
    final ResultProcessor resultProcessor = (callback == null)
            ? null
            : new ResultProcessor(callback) {
        @Override
        public void onSuccess(AppCall appCall, Bundle results) {
            callback.onSuccess(new Result(results.getString("id")));
        }
    };

    CallbackManagerImpl.Callback callbackManagerCallback = new CallbackManagerImpl.Callback() {
        @Override
        public boolean onActivityResult(int resultCode, Intent data) {
            return ShareInternalUtility.handleActivityResult(
                    getRequestCode(),
                    resultCode,
                    data,
                    resultProcessor);
        }
    };

    callbackManager.registerCallback(getRequestCode(), callbackManagerCallback);
}
项目:Move-Alarm_ORCA    文件:LoginManager.java   
/**
 * Registers a login callback to the given callback manager.
 * @param callbackManager The callback manager that will encapsulate the callback.
 * @param callback The login callback that will be called on login completion.
 */
public void registerCallback(
        final CallbackManager callbackManager,
        final FacebookCallback<LoginResult> callback) {
    if (!(callbackManager instanceof CallbackManagerImpl)) {
        throw new FacebookException("Unexpected CallbackManager, " +
                "please use the provided Factory.");
    }
    ((CallbackManagerImpl) callbackManager).registerCallback(
            CallbackManagerImpl.RequestCodeOffset.Login.toRequestCode(),
            new CallbackManagerImpl.Callback() {
                @Override
                public boolean onActivityResult(int resultCode, Intent data) {
                    return LoginManager.this.onActivityResult(
                            resultCode,
                            data,
                            callback);
                }
            }
    );
}
项目:SocioBlood    文件:ShareInternalUtility.java   
public static void registerStaticShareCallback(
        final int requestCode) {
    CallbackManagerImpl.registerStaticCallback(
            requestCode,
            new CallbackManagerImpl.Callback() {
                @Override
                public boolean onActivityResult(int resultCode, Intent data) {
                    return handleActivityResult(
                            requestCode,
                            resultCode,
                            data,
                            getShareResultProcessor(null));
                }
            }
    );
}
项目:SocioBlood    文件:ShareInternalUtility.java   
public static void registerSharerCallback(
        final int requestCode,
        final CallbackManager callbackManager,
        final FacebookCallback<Sharer.Result> callback) {
    if (!(callbackManager instanceof CallbackManagerImpl)) {
        throw new FacebookException("Unexpected CallbackManager, " +
                "please use the provided Factory.");
    }

    ((CallbackManagerImpl) callbackManager).registerCallback(
            requestCode,
            new CallbackManagerImpl.Callback() {
                @Override
                public boolean onActivityResult(int resultCode, Intent data) {
                    return handleActivityResult(
                            requestCode,
                            resultCode,
                            data,
                            getShareResultProcessor(callback));
                }
            });
}
项目:SocioBlood    文件:JoinAppGroupDialog.java   
@Override
protected void registerCallbackImpl (
        final CallbackManagerImpl callbackManager,
        final FacebookCallback<Result> callback) {
    final ResultProcessor resultProcessor = (callback == null)
            ? null
            : new ResultProcessor(callback) {
        @Override
        public void onSuccess(AppCall appCall, Bundle results) {
            callback.onSuccess(new Result(results));
        }
    };

    CallbackManagerImpl.Callback callbackManagerCallback = new CallbackManagerImpl.Callback() {
        @Override
        public boolean onActivityResult(int resultCode, Intent data) {
            return ShareInternalUtility.handleActivityResult(
                    getRequestCode(),
                    resultCode,
                    data,
                    resultProcessor);
        }
    };

    callbackManager.registerCallback(getRequestCode(), callbackManagerCallback);
}
项目:SocioBlood    文件:CreateAppGroupDialog.java   
@Override
protected void registerCallbackImpl(
        final CallbackManagerImpl callbackManager,
        final FacebookCallback<Result> callback) {
    final ResultProcessor resultProcessor = (callback == null)
            ? null
            : new ResultProcessor(callback) {
        @Override
        public void onSuccess(AppCall appCall, Bundle results) {
            callback.onSuccess(new Result(results.getString("id")));
        }
    };

    CallbackManagerImpl.Callback callbackManagerCallback = new CallbackManagerImpl.Callback() {
        @Override
        public boolean onActivityResult(int resultCode, Intent data) {
            return ShareInternalUtility.handleActivityResult(
                    getRequestCode(),
                    resultCode,
                    data,
                    resultProcessor);
        }
    };

    callbackManager.registerCallback(getRequestCode(), callbackManagerCallback);
}
项目:SocioBlood    文件:LoginManager.java   
/**
 * Registers a login callback to the given callback manager.
 * @param callbackManager The callback manager that will encapsulate the callback.
 * @param callback The login callback that will be called on login completion.
 */
public void registerCallback(
        final CallbackManager callbackManager,
        final FacebookCallback<LoginResult> callback) {
    if (!(callbackManager instanceof CallbackManagerImpl)) {
        throw new FacebookException("Unexpected CallbackManager, " +
                "please use the provided Factory.");
    }
    ((CallbackManagerImpl) callbackManager).registerCallback(
            CallbackManagerImpl.RequestCodeOffset.Login.toRequestCode(),
            new CallbackManagerImpl.Callback() {
                @Override
                public boolean onActivityResult(int resultCode, Intent data) {
                    return LoginManager.this.onActivityResult(
                            resultCode,
                            data,
                            callback);
                }
            }
    );
}
项目:kognitivo    文件:LikeActionController.java   
private synchronized static void performFirstInitialize() {
    if (isInitialized) {
        return;
    }

    handler = new Handler(Looper.getMainLooper());

    Context appContext = FacebookSdk.getApplicationContext();
    SharedPreferences sharedPreferences = appContext.getSharedPreferences(
            LIKE_ACTION_CONTROLLER_STORE,
            Context.MODE_PRIVATE);

    objectSuffix = sharedPreferences.getInt(LIKE_ACTION_CONTROLLER_STORE_OBJECT_SUFFIX_KEY, 1);
    controllerDiskCache = new FileLruCache(TAG, new FileLruCache.Limits());

    registerAccessTokenTracker();

    CallbackManagerImpl.registerStaticCallback(
            CallbackManagerImpl.RequestCodeOffset.Like.toRequestCode(),
            new CallbackManagerImpl.Callback() {
                @Override
                public boolean onActivityResult(int resultCode, Intent data) {
                    return handleOnActivityResult(
                            CallbackManagerImpl.RequestCodeOffset.Like.toRequestCode(),
                            resultCode,
                            data);
                }
            });

    isInitialized = true;
}
项目:kognitivo    文件:LikeDialog.java   
@Override
protected void registerCallbackImpl (
        final CallbackManagerImpl callbackManager,
        final FacebookCallback<Result> callback) {
    final ResultProcessor resultProcessor = (callback == null)
            ? null
            : new ResultProcessor(callback) {
        @Override
        public void onSuccess(AppCall appCall, Bundle results) {
            callback.onSuccess(new Result(results));
        }
    };

    CallbackManagerImpl.Callback callbackManagerCallback = new CallbackManagerImpl.Callback() {
        @Override
        public boolean onActivityResult(int resultCode, Intent data) {
            return ShareInternalUtility.handleActivityResult(
                    getRequestCode(),
                    resultCode,
                    data,
                    resultProcessor);
        }
    };

    callbackManager.registerCallback(
            getRequestCode(),
            callbackManagerCallback);
}
项目:kognitivo    文件:ShareDialog.java   
@Override
protected void registerCallbackImpl(
        final CallbackManagerImpl callbackManager,
        final FacebookCallback<Result> callback) {
    ShareInternalUtility.registerSharerCallback(
            getRequestCode(), callbackManager, callback);
}
项目:kognitivo    文件:GameRequestDialog.java   
@Override
protected void registerCallbackImpl(
        final CallbackManagerImpl callbackManager,
        final FacebookCallback<Result> callback) {
    final ResultProcessor resultProcessor = (callback == null)
            ? null
            : new ResultProcessor(callback) {
        @Override
        public void onSuccess(AppCall appCall, Bundle results) {
            if (results != null) {
                callback.onSuccess(new Result(results));
            } else {
                onCancel(appCall);
            }
        }
    };

   callbackManager.registerCallback(
            getRequestCode(),
            new CallbackManagerImpl.Callback() {
                @Override
                public boolean onActivityResult(int resultCode, Intent data) {
                    return ShareInternalUtility.handleActivityResult(
                            getRequestCode(),
                            resultCode,
                            data,
                            resultProcessor);
                }
            });
}
项目:kognitivo    文件:LoginManager.java   
private void startLogin(
        StartActivityDelegate startActivityDelegate,
        LoginClient.Request request
) throws FacebookException {

    logStartLogin(startActivityDelegate.getActivityContext(), request);

    // Make sure the static handler for login is registered if there isn't an explicit callback
    CallbackManagerImpl.registerStaticCallback(
            CallbackManagerImpl.RequestCodeOffset.Login.toRequestCode(),
            new CallbackManagerImpl.Callback() {
                @Override
                public boolean onActivityResult(int resultCode, Intent data) {
                    return LoginManager.this.onActivityResult(resultCode, data);
                }
            }
    );

    boolean started = tryFacebookActivity(startActivityDelegate, request);

    if (!started) {
        FacebookException exception = new FacebookException(
                "Log in attempt failed: FacebookActivity could not be started." +
                        " Please make sure you added FacebookActivity to the AndroidManifest.");
        boolean wasLoginActivityTried = false;
        logCompleteLogin(
                startActivityDelegate.getActivityContext(),
                LoginClient.Result.Code.ERROR,
                null,
                exception,
                wasLoginActivityTried,
                request);
        throw exception;
    }
}
项目:purple-05    文件:MainActivity.java   
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);

    if (requestCode == CallbackManagerImpl.RequestCodeOffset.Login.toRequestCode()) {
        Log.d("ResultCode", "페이스북 로그인");
        callbackManager.onActivityResult(requestCode, resultCode, data);
    }else{
        Log.d("ResultCode", "트위터 로그인");
        twitterLoginButton.onActivityResult(requestCode, resultCode, data);
    }


}
项目:OSS-green-07    文件:MainActivity.java   
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);

    if (requestCode == CallbackManagerImpl.RequestCodeOffset.Login.toRequestCode()) {
        Log.d("ResultCode", "페이스북 로그인");
        callbackManager.onActivityResult(requestCode, resultCode, data);
    }else{
        Log.d("ResultCode", "트위터 로그인");
        twitterLoginButton.onActivityResult(requestCode, resultCode, data);
    }


}
项目:OSS-green-07    文件:HomeActivity.java   
protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
    super.onActivityResult(requestCode, resultCode, intent);

    if (resultCode == -1 && requestCode == PickImageActivity.PICKER_REQUEST_CODE) {
        //가지고 온 이미지들을 이용하여 CardNews 객체 생성.
        CardNewsItem item = new CardNewsItem(this.getIntent().getStringExtra("from"), intent.getExtras().getStringArrayList(PickImageActivity.KEY_DATA_RESULT),headLine);
        cardNewsList.add(item);
        adapter.notifyDataSetChanged();
    }

    if (requestCode == CallbackManagerImpl.RequestCodeOffset.Share.toRequestCode()) {
        callbackManager.onActivityResult(requestCode, resultCode, intent);
    }

}
项目:OSS-purple-06    文件:MainActivity.java   
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);

    if (requestCode == CallbackManagerImpl.RequestCodeOffset.Login.toRequestCode()) {
        Log.d("ResultCode", "페이스북 로그인");
        callbackManager.onActivityResult(requestCode, resultCode, data);
    }else{
        Log.d("ResultCode", "트위터 로그인");
        twitterLoginButton.onActivityResult(requestCode, resultCode, data);
    }


}
项目:OSS-purple-06    文件:HomeActivity.java   
protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
    super.onActivityResult(requestCode, resultCode, intent);

    if (resultCode == -1 && requestCode == PickImageActivity.PICKER_REQUEST_CODE) {
        //가지고 온 이미지들을 이용하여 CardNews 객체 생성.
        CardNewsItem item = new CardNewsItem(this.getIntent().getStringExtra("from"), intent.getExtras().getStringArrayList(PickImageActivity.KEY_DATA_RESULT),headLine);
        cardNewsList.add(item);
        adapter.notifyDataSetChanged();
    }

    if (requestCode == CallbackManagerImpl.RequestCodeOffset.Share.toRequestCode()) {
        callbackManager.onActivityResult(requestCode, resultCode, intent);
    }

}
项目:Move-Alarm_ORCA    文件:LikeActionController.java   
private synchronized static void performFirstInitialize() {
    if (isInitialized) {
        return;
    }

    handler = new Handler(Looper.getMainLooper());

    Context appContext = FacebookSdk.getApplicationContext();
    SharedPreferences sharedPreferences = appContext.getSharedPreferences(
            LIKE_ACTION_CONTROLLER_STORE,
            Context.MODE_PRIVATE);

    objectSuffix = sharedPreferences.getInt(LIKE_ACTION_CONTROLLER_STORE_OBJECT_SUFFIX_KEY, 1);
    controllerDiskCache = new FileLruCache(TAG, new FileLruCache.Limits());

    registerAccessTokenTracker();

    CallbackManagerImpl.registerStaticCallback(
            CallbackManagerImpl.RequestCodeOffset.Like.toRequestCode(),
            new CallbackManagerImpl.Callback() {
                @Override
                public boolean onActivityResult(int resultCode, Intent data) {
                    return handleOnActivityResult(
                            CallbackManagerImpl.RequestCodeOffset.Like.toRequestCode(),
                            resultCode,
                            data);
                }
            });

    isInitialized = true;
}
项目:Move-Alarm_ORCA    文件:ShareDialog.java   
@Override
protected void registerCallbackImpl(
        final CallbackManagerImpl callbackManager,
        final FacebookCallback<Result> callback) {
    ShareInternalUtility.registerSharerCallback(
            getRequestCode(), callbackManager, callback);
}
项目:Move-Alarm_ORCA    文件:GameRequestDialog.java   
@Override
protected void registerCallbackImpl(
        final CallbackManagerImpl callbackManager,
        final FacebookCallback<Result> callback) {
    final ResultProcessor resultProcessor = (callback == null)
            ? null
            : new ResultProcessor(callback) {
        @Override
        public void onSuccess(AppCall appCall, Bundle results) {
            if (results != null) {
                callback.onSuccess(new Result(results.getString(
                        ShareConstants.WEB_DIALOG_RESULT_PARAM_REQUEST_ID)));
            } else {
                onCancel(appCall);
            }
        }
    };

   callbackManager.registerCallback(
            getRequestCode(),
            new CallbackManagerImpl.Callback() {
                @Override
                public boolean onActivityResult(int resultCode, Intent data) {
                    return ShareInternalUtility.handleActivityResult(
                            getRequestCode(),
                            resultCode,
                            data,
                            resultProcessor);
                }
            });
}
项目:Move-Alarm_ORCA    文件:LoginManager.java   
private void startLogin(
        StartActivityDelegate startActivityDelegate,
        LoginClient.Request request
) throws FacebookException {

    this.pendingLoginRequest = request;
    this.pendingLoggingExtras = new HashMap<>();
    this.context = startActivityDelegate.getActivityContext();

    logStartLogin();

    // Make sure the static handler for login is registered if there isn't an explicit callback
    CallbackManagerImpl.registerStaticCallback(
            CallbackManagerImpl.RequestCodeOffset.Login.toRequestCode(),
            new CallbackManagerImpl.Callback() {
                @Override
                public boolean onActivityResult(int resultCode, Intent data) {
                    return LoginManager.this.onActivityResult(resultCode, data);
                }
            }
    );

    boolean started = tryLoginActivity(startActivityDelegate, request);

    pendingLoggingExtras.put(
            LoginLogger.EVENT_EXTRAS_TRY_LOGIN_ACTIVITY,
            started ?
            AppEventsConstants.EVENT_PARAM_VALUE_YES : AppEventsConstants.EVENT_PARAM_VALUE_NO
    );

    if (!started) {
        FacebookException exception = new FacebookException(
                "Log in attempt failed: LoginActivity could not be started");
        logCompleteLogin(LoginClient.Result.Code.ERROR, null, exception);
        this.pendingLoginRequest = null;
        throw exception;
    }
}
项目:SocioBlood    文件:LikeActionController.java   
private synchronized static void performFirstInitialize() {
    if (isInitialized) {
        return;
    }

    handler = new Handler(Looper.getMainLooper());

    Context appContext = FacebookSdk.getApplicationContext();
    SharedPreferences sharedPreferences = appContext.getSharedPreferences(
            LIKE_ACTION_CONTROLLER_STORE,
            Context.MODE_PRIVATE);

    objectSuffix = sharedPreferences.getInt(LIKE_ACTION_CONTROLLER_STORE_OBJECT_SUFFIX_KEY, 1);
    controllerDiskCache = new FileLruCache(TAG, new FileLruCache.Limits());

    registerAccessTokenTracker();

    CallbackManagerImpl.registerStaticCallback(
            CallbackManagerImpl.RequestCodeOffset.Like.toRequestCode(),
            new CallbackManagerImpl.Callback() {
                @Override
                public boolean onActivityResult(int resultCode, Intent data) {
                    return handleOnActivityResult(
                            CallbackManagerImpl.RequestCodeOffset.Like.toRequestCode(),
                            resultCode,
                            data);
                }
            });

    isInitialized = true;
}
项目:SocioBlood    文件:ShareDialog.java   
@Override
protected void registerCallbackImpl(
        final CallbackManagerImpl callbackManager,
        final FacebookCallback<Result> callback) {
    ShareInternalUtility.registerSharerCallback(
            getRequestCode(), callbackManager, callback);
}
项目:SocioBlood    文件:GameRequestDialog.java   
@Override
protected void registerCallbackImpl(
        final CallbackManagerImpl callbackManager,
        final FacebookCallback<Result> callback) {
    final ResultProcessor resultProcessor = (callback == null)
            ? null
            : new ResultProcessor(callback) {
        @Override
        public void onSuccess(AppCall appCall, Bundle results) {
            if (results != null) {
                callback.onSuccess(new Result(results));
            } else {
                onCancel(appCall);
            }
        }
    };

   callbackManager.registerCallback(
            getRequestCode(),
            new CallbackManagerImpl.Callback() {
                @Override
                public boolean onActivityResult(int resultCode, Intent data) {
                    return ShareInternalUtility.handleActivityResult(
                            getRequestCode(),
                            resultCode,
                            data,
                            resultProcessor);
                }
            });
}
项目:SocioBlood    文件:LoginManager.java   
private void startLogin(
        StartActivityDelegate startActivityDelegate,
        LoginClient.Request request
) throws FacebookException {

    this.pendingLoginRequest = request;
    this.pendingLoggingExtras = new HashMap<>();
    this.context = startActivityDelegate.getActivityContext();

    logStartLogin();

    // Make sure the static handler for login is registered if there isn't an explicit callback
    CallbackManagerImpl.registerStaticCallback(
            CallbackManagerImpl.RequestCodeOffset.Login.toRequestCode(),
            new CallbackManagerImpl.Callback() {
                @Override
                public boolean onActivityResult(int resultCode, Intent data) {
                    return LoginManager.this.onActivityResult(resultCode, data);
                }
            }
    );

    boolean started = tryFacebookActivity(startActivityDelegate, request);

    pendingLoggingExtras.put(
            LoginLogger.EVENT_EXTRAS_TRY_LOGIN_ACTIVITY,
            started ?
            AppEventsConstants.EVENT_PARAM_VALUE_YES : AppEventsConstants.EVENT_PARAM_VALUE_NO
    );

    if (!started) {
        FacebookException exception = new FacebookException(
                "Log in attempt failed: FacebookActivity could not be started." +
                        " Please make sure you added FacebookActivity to the AndroidManifest.");
        logCompleteLogin(LoginClient.Result.Code.ERROR, null, exception);
        this.pendingLoginRequest = null;
        throw exception;
    }
}
项目:kognitivo    文件:MessageDialog.java   
@Override
protected void registerCallbackImpl(
        final CallbackManagerImpl callbackManager,
        final FacebookCallback<Result> callback) {
    ShareInternalUtility.registerSharerCallback(getRequestCode(), callbackManager, callback);
}
项目:kognitivo    文件:ShareButton.java   
@Override
protected int getDefaultRequestCode() {
    return CallbackManagerImpl.RequestCodeOffset.Share.toRequestCode();
}
项目:kognitivo    文件:SendButton.java   
@Override
protected int getDefaultRequestCode() {
    return CallbackManagerImpl.RequestCodeOffset.Message.toRequestCode();
}
项目:kognitivo    文件:LoginClient.java   
public static int getLoginRequestCode() {
    return CallbackManagerImpl.RequestCodeOffset.Login.toRequestCode();
}
项目:kognitivo    文件:LoginButton.java   
@Override
protected int getDefaultRequestCode() {
    return CallbackManagerImpl.RequestCodeOffset.Login.toRequestCode();
}
项目:letv    文件:CallbackManager.java   
public static CallbackManager create() {
    return new CallbackManagerImpl();
}