I am trying to integrate the Android Android SDK into my application, but it seems that I can not get the most basic authentication. I have my project setup, my Facebook app id, all that is required.
I start Facebook authentication with a simple OnClickListener ():
signIn_Facebook.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { Log.i("MyTag", "Facebook authorize about to start."); facebook.authorize(SignIn.this, new FacebookLoginDialogListener()); } });
My problem is that none of the methods in DialogListener has ever been called:
private class FacebookLoginDialogListener implements DialogListener { public void onComplete(Bundle values) { Log.i("MyTag", "Facebook authorize complete."); } @Override public void onFacebookError(FacebookError error) { Log.i("MyTag", "Facebook authorize facebook error."); } @Override public void onError(DialogError e) { Log.i("MyTag", "Facebook authorize dialog error."); } @Override public void onCancel() { Log.i("MyTag", "Facebook authorize cancel."); } }
When this code is launched in the application, the Facebook dialog box opens, you can enter it and then it just closes - no errors - however, none of the log messages (or breakpoints) in the FacebookLoginDialogListener class are called.
It seems to me that I'm missing something really obvious. Thanks...
solvable
Just need to add:
protected void onActivityResult(int requestCode, int resultCode, Intent data) { facebook.authorizeCallback(requestCode, resultCode, data); }
source share