小编Ruc*_*eda的帖子

Session.StatusCallback无法解析为某种类型--Facebook API

我按照Facebook上的登录验证教程,将以下代码复制到我的Android应用程序中

private Session.StatusCallback callback = 
    new Session.StatusCallback()
{
    @Override
    public void call(Session session, 
            SessionState state, Exception exception) {
        onSessionStateChange(session, state, exception);
    }
};
Run Code Online (Sandbox Code Playgroud)

但是,它给了我以下错误:

Session.StatusCallback cannot be resolved to a type
Run Code Online (Sandbox Code Playgroud)

这导致以下错误:

callback cannot be resolved to a variable
Run Code Online (Sandbox Code Playgroud)

Facebook API调用的其他地方也给我带来了错误,但并不是所有的Facebook API调用.另一个我收到错误的地方如下:

Request request = Request.newMeRequest(session, 
                    new Request.GraphUserCallback() {
                @Override
                public void onCompleted(GraphUser user, Response response) {
                    // If the response is successful
                    if (session == Session.getActiveSession()) {
                        if (user != null) {
                            // Set the id for the ProfilePictureView …
Run Code Online (Sandbox Code Playgroud)

eclipse android facebook facebook-authentication facebook-android-sdk

4
推荐指数
1
解决办法
1万
查看次数