Search code examples
androidfacebook-sdk-3.0

Request.GraphUserCallback cannot be resolved to a type


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;

Solution

  • I got it right..Add

    import com.facebook.Request;