Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 

 2 Answer(s)

  • 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 ;)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: