Request.GraphUserCallback无法解析为某种类型

时间:2014-08-02 10:15:27

标签: android facebook-sdk-3.0

我收到错误 - " 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;

1 个答案:

答案 0 :(得分:1)

我做对了..添加

import com.facebook.Request;