'Is it possible to make buttons inside FirebaseAuthUIActivityResultContract work inside Fragments? FirebaseUI

By running this code it will take me to FirebaseAuthUIActivityResultContract and it will appear 3 buttons: Email, Google, and Facebook button.

List <AuthUI.IdpConfig> providers = Arrays.asList(
    new AuthUI.IdpConfig.EmailBuilder().build(),
    new AuthUI.IdpConfig.GoogleBuilder().build(),
    new AuthUI.IdpConfig.FacebookBuilder().build());

ActivityResultLauncher <Intent> signInLauncher = registerForActivityResult(new FirebaseAuthUIActivityResultContract(), result -> {
    ...
});

signInLauncher.launch(AuthUI.getInstance().createSignInIntentBuilder().setAvailableProviders(providers).build());

enter image description here

I created LoginFragment and it contain 3 buttons, It looks similar like the image above but the difference is the 3 buttons inside LoginFramgnt are not inside the FirebaseAuthUIActivityResultContract activity.

What I'm looking for?

I'm looking for a way to make buttons inside LoginFragment do the same functionality that buttons inside the FirebaseAuthUIActivityResultContract activity does.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source