Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook callbackManager method onActivityResult not calling in Fragment onActivityResult method

I have implemented Facebook integration and it's working fine in part of initialization even Facebook APPID is also fine with application.

So let me explain in more detail : I have added and initialize Facebook in onCreate().

// Facebook callback manager
callbackManager = CallbackManager.Factory.create();

Also override a method in fragment as well in Fragment Activity.

@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    callbackManager.onActivityResult(requestCode, resultCode, data);
}

This method is same in both Activity and Fragment class.

But the issue is when i request of facebook AppInviteContent to show a AppInviteDialog than it is perfectly called onActivityResult method in Activity but not getting called in Fragment method.

If anyone have insight than give me any suggestion. Any comment or suggestion are welcome.

like image 317
QuokMoon Avatar asked Nov 27 '25 07:11

QuokMoon


1 Answers

According to facebook documentations, In a fragment, you should call this method

> Java 

loginButton.setFragment(this);
> Kotlin

loginButton.fragment = this
like image 68
Ibrahim Muhamad Avatar answered Nov 29 '25 19:11

Ibrahim Muhamad



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!