gpt4 book ai didi

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

转载 作者:塔克拉玛干 更新时间:2023-11-02 23:33:58 25 4
gpt4 key购买 nike

我遵循了 Facebook 上的登录身份验证教程,并将以下代码复制到我的 android 应用程序中

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

但是,它给我以下错误:

Session.StatusCallback cannot be resolved to a type

这会导致以下错误:

callback cannot be resolved to a variable

在其他地方进行 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
// view that in turn displays the profile picture.
Log.d("MainActivity", "onComplete() User logged in");
parent.owner = MainKickback.userConnection.add(new User(user.getId()));

EventFragment e = (EventFragment) fragments[UPCOMING_EVENTS];
e.populateEvents();
}
}
if (response.getError() != null) {
// Handle errors, will do so later.
}
}
});
request.executeAsync();

它不识别 Request.GraphUserCallback 的地方,然后是 executeAsync()。我收到以下错误:

Request.GraphUserCallback cannot be resolved to a type
The method executeAsync() is undefined for the type DownloadManager.Request

有人对如何解决这个问题有任何建议吗?

提前感谢您的帮助!!

最佳答案

我遇到了和你第一个问题一样的问题,我通过删除解决了

import android.service.textservice.SpellCheckerService.Session;

并添加

import com.facebook.Session;

关于android - Session.StatusCallback 无法解析为类型 - Facebook API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16926123/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com