title: Unable to get profile info from Facebook in android SDK 4
body: <p>I am unable to get basic profile info from the <code>ProfileTracker</code> function from Facebook SDK v4. How can I get all the info?</p>
  
  <p>I am currently successfully logging in and geting <code>accesstoken</code> and <code>user-id</code>. </p>
  
  <p>Code:</p>
  
  <pre><code>public class HelloFacebookSampleActivity extends FragmentActivity {
  
  
  
      LoginButton loginButton ;
  
      CallbackManager callbackManager;
  
  
      private String fbUserID;
      private String fbProfileName;
      private String fbAuthToken;
  
      private AccessTokenTracker accessTokenTracker;
  
  
      private ProfileTracker profileTracker;
  
  
      private static final String TAG = "FacebookLogin";
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
  
  
  
          FacebookSdk.sdkInitialize(getApplicationContext());
  
          callbackManager = CallbackManager.Factory.create();
  
          setContentView(R.layout.test);
          loginButton = (LoginButton) findViewById(R.id.login_button);
          loginButton.setReadPermissions("user_friends,email,user_birthday,user_likes");
  
  
  
          profileTracker = new ProfileTracker() {
              @Override
              protected void onCurrentProfileChanged(
                      Profile oldProfile,
                      Profile currentProfile) {
  
  
                  fbProfileName = currentProfile.getName();
  
                  Toast.makeText(getBaseContext(),"profile",Toast.LENGTH_LONG).show();
  
  
                  Log.d(TAG, "FirstName: " + currentProfile.getFirstName() );
  
                  Log.d(TAG, "LastName: " + currentProfile.getLastName() );
  
                  Log.d(TAG, " MiddleName: " + currentProfile.getMiddleName() );
  
                  Log.d(TAG, "LinkUri: " + currentProfile.getLinkUri() );
  
                  Log.d(TAG, "ProfilePictureUri: " + currentProfile.getProfilePictureUri(250,250) );
  
  
  
  
              }
          };
  
  
          accessTokenTracker = new AccessTokenTracker() {
              @Override
              protected void onCurrentAccessTokenChanged(
                      AccessToken oldAccessToken,
                      AccessToken currentAccessToken) {
                  fbAuthToken = currentAccessToken.getToken();
                  fbUserID = currentAccessToken.getUserId();
  
  
  
                  Log.d(TAG, "User id: " + fbUserID);
                  Log.d(TAG, "Access token is: " + fbAuthToken);
  
  
                  // Ensure that our profile is up to date
                  Profile.fetchProfileForCurrentAccessToken();
              }
          };
  
  
  
  
          // Callback registration
          loginButton.registerCallback(callbackManager, new FacebookCallback&lt;LoginResult&gt;() {
              @Override
              public void onSuccess(LoginResult loginResult) {
  
  
  
  
              }
  
              @Override
              public void onCancel() {
                  // App code
  
                  Toast.makeText(getBaseContext(),"cancel",Toast.LENGTH_LONG).show();
              }
  
              @Override
              public void onError(FacebookException exception) {
                  // App code
                  Toast.makeText(getBaseContext(),"er",Toast.LENGTH_LONG).show();
              }
          });
  
  
  
  
  
  
  
  
  
  
      }
  
  
  
  
      @Override
      public void onDestroy() {
          super.onDestroy();
  
          accessTokenTracker.stopTracking();
          profileTracker.stopTracking();
      }
  
  
      @Override
      protected void onActivityResult(int requestCode, int resultCode, Intent data) {
          super.onActivityResult(requestCode, resultCode, data);
          callbackManager.onActivityResult(requestCode, resultCode, data);
      }
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>java.lang.NullPointerException: Attempt to invoke interface method 'void com.android.okhttp.internal.http.Transport.writeRequestHeaders(com.android.okhttp.Request)' on a null object reference
          at com.android.okhttp.internal.http.HttpEngine.readResponse(HttpEngine.java:611)
          at com.android.okhttp.internal.http.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:388)
          at com.android.okhttp.internal.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:332)
          at com.android.okhttp.internal.http.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:500)
          at com.android.okhttp.internal.http.DelegatingHttpsURLConnection.getResponseCode(DelegatingHttpsURLConnection.java:105)
          at com.android.okhttp.internal.http.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:25)
  </code></pre>