Skip to content

Instantly share code, notes, and snippets.

@Gazer
Created December 29, 2015 21:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Gazer/7e1d2d19fee260f4b1c2 to your computer and use it in GitHub Desktop.
Save Gazer/7e1d2d19fee260f4b1c2 to your computer and use it in GitHub Desktop.
super.onViewCreated(view, savedInstanceState);
ButterKnife.inject(this, view);
callbackManager = CallbackManager.Factory.create();
facebookLoginButton.setFragment(this);
facebookLoginButton.registerCallback(callbackManager, presenter);
presenter.bindView(this);
@Override
public void onSuccess(LoginResult loginResult) {
// do something with the facebook result and notify UI.
// here you can store the FB UserID on a backend
}
@Override
public void onCancel() {
view().showLoginError("canceled");
}
@Override
public void onError(FacebookException error) {
view().showLoginError("error " + error);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment