• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java CallbackManagerImpl类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



CallbackManagerImpl类属于com.facebook.internal包,在下文中一共展示了CallbackManagerImpl类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: registerStaticShareCallback

import com.facebook.internal.CallbackManagerImpl; //导入依赖的package包/类
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));
                }
            }
    );
}
 
开发者ID:eviltnan,项目名称:kognitivo,代码行数:17,代码来源:ShareInternalUtility.java


示例2: registerSharerCallback

import com.facebook.internal.CallbackManagerImpl; //导入依赖的package包/类
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));
                }
            });
}
 
开发者ID:eviltnan,项目名称:kognitivo,代码行数:23,代码来源:ShareInternalUtility.java


示例3: registerCallbackImpl

import com.facebook.internal.CallbackManagerImpl; //导入依赖的package包/类
@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);
}
 
开发者ID:eviltnan,项目名称:kognitivo,代码行数:27,代码来源:JoinAppGroupDialog.java


示例4: registerCallbackImpl

import com.facebook.internal.CallbackManagerImpl; //导入依赖的package包/类
@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);
}
 
开发者ID:eviltnan,项目名称:kognitivo,代码行数:27,代码来源:CreateAppGroupDialog.java


示例5: registerCallback

import com.facebook.internal.CallbackManagerImpl; //导入依赖的package包/类
/**
 * 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);
                }
            }
    );
}
 
开发者ID:eviltnan,项目名称:kognitivo,代码行数:26,代码来源:LoginManager.java


示例6: onActivityResult

import com.facebook.internal.CallbackManagerImpl; //导入依赖的package包/类
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);
    }


}
 
开发者ID:hij2696,项目名称:purple-05,代码行数:17,代码来源:HomeActivity.java


示例7: performFirstInitialize

import com.facebook.internal.CallbackManagerImpl; //导入依赖的package包/类
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;
}
 
开发者ID:eviltnan,项目名称:kognitivo,代码行数:32,代码来源:LikeActionController.java


示例8: registerCallbackImpl

import com.facebook.internal.CallbackManagerImpl; //导入依赖的package包/类
@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);
}
 
开发者ID:eviltnan,项目名称:kognitivo,代码行数:29,代码来源:LikeDialog.java


示例9: registerCallbackImpl

import com.facebook.internal.CallbackManagerImpl; //导入依赖的package包/类
@Override
protected void registerCallbackImpl(
        final CallbackManagerImpl callbackManager,
        final FacebookCallback<Result> callback) {
    ShareInternalUtility.registerSharerCallback(
            getRequestCode(), callbackManager, callback);
}
 
开发者ID:eviltnan,项目名称:kognitivo,代码行数:8,代码来源:ShareDialog.java


示例10: registerCallbackImpl

import com.facebook.internal.CallbackManagerImpl; //导入依赖的package包/类
@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);
                }
            });
}
 
开发者ID:eviltnan,项目名称:kognitivo,代码行数:31,代码来源:GameRequestDialog.java


示例11: startLogin

import com.facebook.internal.CallbackManagerImpl; //导入依赖的package包/类
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;
    }
}
 
开发者ID:eviltnan,项目名称:kognitivo,代码行数:36,代码来源:LoginManager.java


示例12: onActivityResult

import com.facebook.internal.CallbackManagerImpl; //导入依赖的package包/类
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);
    }


}
 
开发者ID:hij2696,项目名称:purple-05,代码行数:14,代码来源:MainActivity.java


示例13: onActivityResult

import com.facebook.internal.CallbackManagerImpl; //导入依赖的package包/类
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);
    }

}
 
开发者ID:gugusny5758,项目名称:OSS-green-07,代码行数:16,代码来源:HomeActivity.java


示例14: registerCallbackImpl

import com.facebook.internal.CallbackManagerImpl; //导入依赖的package包/类
@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);
                }
            });
}
 
开发者ID:CE-KMITL-OOAD-2015,项目名称:Move-Alarm_ORCA,代码行数:32,代码来源:GameRequestDialog.java


示例15: startLogin

import com.facebook.internal.CallbackManagerImpl; //导入依赖的package包/类
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;
    }
}
 
开发者ID:CE-KMITL-OOAD-2015,项目名称:Move-Alarm_ORCA,代码行数:39,代码来源:LoginManager.java


示例16: startLogin

import com.facebook.internal.CallbackManagerImpl; //导入依赖的package包/类
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;
    }
}
 
开发者ID:yudiandreanp,项目名称:SocioBlood,代码行数:40,代码来源:LoginManager.java


示例17: registerCallbackImpl

import com.facebook.internal.CallbackManagerImpl; //导入依赖的package包/类
@Override
protected void registerCallbackImpl(
        final CallbackManagerImpl callbackManager,
        final FacebookCallback<Result> callback) {
    ShareInternalUtility.registerSharerCallback(getRequestCode(), callbackManager, callback);
}
 
开发者ID:eviltnan,项目名称:kognitivo,代码行数:7,代码来源:MessageDialog.java


示例18: getDefaultRequestCode

import com.facebook.internal.CallbackManagerImpl; //导入依赖的package包/类
@Override
protected int getDefaultRequestCode() {
    return CallbackManagerImpl.RequestCodeOffset.Share.toRequestCode();
}
 
开发者ID:eviltnan,项目名称:kognitivo,代码行数:5,代码来源:ShareButton.java


示例19: getDefaultRequestCode

import com.facebook.internal.CallbackManagerImpl; //导入依赖的package包/类
@Override
protected int getDefaultRequestCode() {
    return CallbackManagerImpl.RequestCodeOffset.Message.toRequestCode();
}
 
开发者ID:eviltnan,项目名称:kognitivo,代码行数:5,代码来源:SendButton.java


示例20: getLoginRequestCode

import com.facebook.internal.CallbackManagerImpl; //导入依赖的package包/类
public static int getLoginRequestCode() {
    return CallbackManagerImpl.RequestCodeOffset.Login.toRequestCode();
}
 
开发者ID:eviltnan,项目名称:kognitivo,代码行数:4,代码来源:LoginClient.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Email类代码示例发布时间:2022-05-23
下一篇:
Java StreamHeader12类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap