title: Facebook SDK login works but then closes app after
body: <p>I have an app that has its own login system, where by the user enters a email and password and it checks against a remote MySql server, logs the user in if it finds the user otherwise asks them to register.</p>
  
  <p>I am know trying to integrate Facebook so that the user can press a button and login with their Facebook account. 
  I have found the "android simple facebook" library <a href="https://github.com/sromku/android-simple-facebook" rel="nofollow">https://github.com/sromku/android-simple-facebook</a></p>
  
  <p>And am trying to use this to integrate Facebook with my app. I have the below code so far, and everything seems to work however after the user logs into facebook my app just closes.
  So far I have the below code:</p>
  
  <pre><code>SimpleFacebookConfiguration configuration = new SimpleFacebookConfiguration.Builder()
          .setAppId("*******8")
          .setNamespace("********")
          .setPermissions(permissions)
          .build();
  
          SimpleFacebook.setConfiguration(configuration);
  
          fblogin.setOnClickListener(new View.OnClickListener() {
  
              public void onClick(View v) {
                  OnLoginListener onLoginListener = new SimpleFacebook.OnLoginListener()
                  {
  
                      @Override
                      public void onFail(String reason)
                      {
                          Log.w(TAG, reason);
                      }
  
                      @Override
                      public void onException(Throwable throwable)
                      {
                          Log.e(TAG, "Bad thing happened", throwable);
                      }
  
                      @Override
                      public void onThinking()
                      {
                          // show progress bar or something to the user while login is happening
                          Log.i(TAG, "In progress");
                      }
  
                      @Override
                      public void onLogin()
                      {
                          // change the state of the button or do whatever you want
                          Log.i(TAG, "Logged in");
                      }
  
                      @Override
                      public void onNotAcceptingPermissions()
                      {
                          Log.w(TAG, "User didn't accept read permissions");
                      }
  
                  };
                  mSimpleFacebook.login(onLoginListener);
              }
          });
      }   
  </code></pre>
  
  <p>Where:</p>
  
  <pre><code>Permissions[] permissions = new Permissions[]
              {
                  Permissions.EMAIL,
              };
  </code></pre>
  
  <p>When the user clicks the fblogin button the facebook login popup comes up, the user can login and allow my app access to their information, and then the popup closes and so does my app.</p>