title: Facebook login not working with Parse Android SDK
body: <p>I'v tried a lot of solutions to implement Facebook login based on the Parse SDK without success.
  It seems like I'm missing something.</p>
  
  <h2>Generating Facebook hash</h2>
  
  <p>I tried to generate the hash with this command (and many others) and password = android:</p>
  
  <blockquote>
    <blockquote>
      <p>keytool -exportcert -alias androiddebugkey -keystore C:\Users\Ido\.android\debug.keystore | openssl sha1 -binary | openssl base64</p>
    </blockquote>
  </blockquote>
  
  <p>But it didn't work for me, every time I tried to login I got an error that the hash key is not authorized.
  Putting this code in the Appliction OnCreate made the work for me (I didn't get the error anymore):</p>
  
  <pre><code>try {
          PackageInfo info =     getPackageManager().getPackageInfo("com.idob.soccertimer",     PackageManager.GET_SIGNATURES);
          for (Signature signature : info.signatures) {
              MessageDigest md = MessageDigest.getInstance("SHA");
              md.update(signature.toByteArray());
              String sign= Base64.encodeToString(md.digest(), Base64.DEFAULT);
              Log.e("MY KEY HASH:", sign);
              Toast.makeText(getApplicationContext(), sign, Toast.LENGTH_LONG).show();
          }
      } catch (PackageManager.NameNotFoundException e) {
      } catch (NoSuchAlgorithmException e) {
      }
  </code></pre>
  
  <h2>Application implementation</h2>
  
  <p>I made the adjustments for the Facebook and Parse:</p>
  
  <p>Initialize in the onCreate of the Application:</p>
  
  <blockquote>
    <p>ParseFacebookUtils.initialize(getString(R.string.facebook_app_id));</p>
  </blockquote>
  
  <p>Overriding the onActivityResult method in my loginFragment:</p>
  
  <pre><code>public void onActivityResult(int requestCode, int resultCode, Intent data) {
      super.onActivityResult(requestCode, resultCode, data);
      ParseFacebookUtils.finishAuthentication(requestCode, resultCode, data);
  }
  </code></pre>
  
  <p>Add meta tag:</p>
  
  <pre><code>&lt;meta-data
          android:name="com.facebook.sdk.ApplicationId"
          android:value="@string/facebook_app_id"/&gt;
  </code></pre>
  
  <p>I use this code to login:</p>
  
  <pre><code>ParseFacebookUtils.logIn(getActivity(), new LogInCallback() {
                  @Override
                  public void done(ParseUser user, ParseException err) {
                      if (user != null) {
                          Log.e("MyApp", err.getMessage());
                      }
                      if (user == null) {
                          Log.d("MyApp", "Uh oh. The user cancelled the Facebook login.");
                      } else if (user.isNew()) {
                          Log.d("MyApp", "User signed up and logged in through Facebook!");
                      } else {
                          Log.d("MyApp", "User logged in through Facebook!");
                      }
                  }
              });
  </code></pre>
  
  <p>My problem is that the LogInCallback don't call, when I try to login twice - one LogInCallback is  returned with user = null and err = null
  The OnActivityResult is not called at all.</p>