-
Facebook Login Button
over 8 years ago
-
over 8 years ago
link textyou can set callback of Facebook Login in android default widget button or any View like below:-
buttonFbLogin.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { mFbLoginManager.logInWithReadPermissions(LoginActivity.this, Arrays.asList("email", "public_profile", "user_birthday")); } });
Here buttonfbLogin is you button not Fb default button.
and below is FbManager and Callback
com.facebook.login.LoginManager fbLoginManager; fbLoginManager = com.facebook.login.LoginManager.getInstance(); CallbackManager callbackManager = CallbackManager.Factory.create(); mFbLoginManager.registerCallback(callbackManager, new FacebookCallback<LoginResult>() { @Override public void onSuccess(LoginResult loginResult) { // here write code When Login successfully } @Override public void onCancel() { } @Override public void onError(FacebookException e) { // here write code when get error } });
Below link will help you better.
http://androidammy.blogspot.in/2015/09/facebook-login-with-custom-button.html
Let me know if stuck anywhere.
Happy Coding ;)
-
-
over 8 years ago
Hi Manmohan,
Hope this blog help you. http://findnerd.com/list/view/How-to-Customize-Facebook-Login-Button-On-Android/18725/
-
2 Answer(s)