Android - facebook登录错误

时间:2016-10-16 01:35:34

标签: android facebook

Logcat

enter image description here

我有这段代码

    FacebookSdk.sdkInitialize(getApplicationContext()); 
    setContentView(R.layout.activity_social);

    callbackManager = CallbackManager.Factory.create();
    info = (TextView)findViewById(R.id.info);
    loginButton = (LoginButton)findViewById(R.id.login_button);

    loginButton.registerCallback(callbackManager, new FacebookCallback<LoginResult>() {
        @Override
        public void onSuccess(LoginResult loginResult) {
            info.setText(
                    "User ID: "
                    + loginResult.getAccessToken().getUserId() 
                    + "\n" +
                    "Auth Token: "
                    + loginResult.getAccessToken().getToken()
                );
        }
    });
}

运行它时应用程序崩溃。我不知道为什么这次撞车,请帮帮我!感谢

0 个答案:

没有答案