Request.GraphUserCallback cannot be resolved to a type

别说谁变了你拦得住时间么 提交于 2019-12-12 02:07:15

问题


I am getting error-"Request.GraphUserCallback cannot be resolved to a type" in the flollowing code..

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();
        }
      }
    });

I have added FacebookSDK library and following facebook imports

import com.facebook.Session;
import com.facebook.SessionState;
import com.facebook.model.*;
import com.facebooklogin.R;

回答1:


I got it right..Add

import com.facebook.Request;


来源:https://stackoverflow.com/questions/25093932/request-graphusercallback-cannot-be-resolved-to-a-type

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!