【发布时间】:2013-06-04 19:40:42
【问题描述】:
我按照 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的地方,然后执行Async()。我收到以下错误:
Request.GraphUserCallback cannot be resolved to a type
The method executeAsync() is undefined for the type DownloadManager.Request
有人对如何解决这个问题有任何建议吗?
提前感谢您的帮助!!
【问题讨论】:
标签: android eclipse facebook facebook-android-sdk facebook-authentication