I'm trying to login Facebook using custom interface it worked fine in Activity class. same thing i have to do in Fragment too. but Callback is not executing. is it not possible to add CallbackResult in Fragment's OnActivityResult ??
You can use a six digit text message (SMS) code sent to your mobile phone. By tapping your security key on a compatible device. With a security code from a third party app you've associated with your Facebook account. You can approve your login attempt from a device we already recognize.
To use the Facebook SDK in an Android Studio project, add the SDK as a build dependency and import the SDK. Go to Android Studio | New Project | Minimum SDK. Select API 15: Android 4.0. 3 (IceCreamSandwich) or higher and create your new project.
You just need to add this code in your Activity onActivityResult.
for (Fragment fragment : getSupportFragmentManager().getFragments()) {
//System.out.println("@#@");
fragment.onActivityResult(requestCode, resultCode, data);
}
Then your fragment onActivityResult will surely gonna work.
@Override
public void onActivityResult(final int requestCode, final int resultCode, final Intent data) {
callbackManager.onActivityResult(requestCode, resultCode, data);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With