我收到错误 - " Request.GraphUserCallback无法解析为类型"在随后的代码..
Session.openActiveSession(this, true, new Session.StatusCallback() {
// callback when session changes state
@Override
public void call(Session session, SessionState state, Exception exception) {
if (session.isOpened()) {
// make request to the /me API
Request.newMeRequest(session, new Request.GraphUserCallback() {
// callback after Graph API response with user object
@Override
public void onCompleted(GraphUser user, Response response) {
if (user != null) {
TextView welcome = (TextView) findViewById(R.id.welcome);
welcome.setText("You are logged in as " + user.getName() + "!");
}
}
}).executeAsync();
}
}
});
我添加了FacebookSDK库并跟随facebook导入
import com.facebook.Session;
import com.facebook.SessionState;
import com.facebook.model.*;
import com.facebooklogin.R;
答案 0 :(得分:1)
我做对了..添加
import com.facebook.Request;