title: How to get current access token in Facebook Android SDK V4?
body: <p>I want to check whether the user is logged in or not within the main FragmentActivity but although the user is logged in </p>
  
  <blockquote>
    <p>AccessToken.getCurrentAccessToken()</p>
  </blockquote>
  
  <p>returns null.
  What am I doing wrong in the code below ?</p>
  
  <pre><code>public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      context = this;          
      FacebookSdk.sdkInitialize(context);
      callbackManager = CallbackManager.Factory.create();
      AccessToken accessToken = AccessToken.getCurrentAccessToken();
      if (accessToken != null) {
          if (!accessToken.isExpired()) {
  
          }
      }
  }
  </code></pre>