title: How to add a logout callback for facebook sdk in android
body: <p>I have integrated Facebook sdk in my android app. As described in the manual I added the login callback for facebook. But I have to change the UI if the user logs out from facebook. Where do I put that code. My code for login is </p>
  
  <pre><code>         /**
           * Login Callback for facebook login
           */
          callbackManager = CallbackManager.Factory.create();
  
      LoginManager.getInstance().registerCallback(callbackManager,
              new FacebookCallback&lt;LoginResult&gt;() {
  
                  @Override
                  public void onSuccess(LoginResult loginResult) {
                      //Call updateUI()
  
                      setData("provider","facebook");
                      loginType = LoginTypes.FB_LOGIN;
                      isLoggedin = true;
                      GraphRequest request = GraphRequest.newMeRequest(
                              loginResult.getAccessToken(),
                              new GraphRequest.GraphJSONObjectCallback() {
                                  @Override
                                  public void onCompleted(
                                          JSONObject object,
                                          GraphResponse response) {
                                      // Application code
  
                                      txtName.setText(response.toString());
                                      updateUI();
                                  }
                              });
                      Bundle parameters = new Bundle();
                      parameters.putString("fields", "id,name,email");
                      request.setParameters(parameters);
                      request.executeAsync();
                  }
  
                  @Override
                  public void onCancel() {
                      editText_message.setText("Login Cancelled.");
                      // App code
                  }
  
                  @Override
                  public void onError(FacebookException exception) {
                      // App code
                  }
              });
  </code></pre>