Closed ArcherEmiya05 closed 2 years ago
This issue was solved after moving the initialization of activityResultLauncher
inside onCreate
since calling UiModeManager setApplicationNightMode
will trigger configuration changes which recreates the Activity.
Welcome to FirebaseUI and thanks for submitting an issue!
Please take a look at open issues, as well as resolved issues, to see if your issue is either already being addressed, or has been solved by someone else.
If not, please feel free to fill in the following info so we can help faster!
Step 1: Are you in the right place?
Yes
Step 2: Describe your environment
Step 3: Describe the problem:
We are calling
UiModeManager setApplicationNightMode
in Application class and the start up Activity launch Firebase Phone Auth intent. According to Android documentationIt could be that by the time when configuration change occur, the launching of Phone Auth UI Activity also happen. In this case what work around can we possibly do?
Steps to reproduce:
Observed Results:
Attempting to launch an unregistered ActivityResultLauncher with contract androidx.activity.result.contract.ActivityResultContracts$StartActivityForResult@57b4f96 and input Intent { cmp=com.sample.app/com.firebase.ui.auth.KickoffActivity (has extras) }. You must ensure the ActivityResultLauncher is registered before calling launch().
Note that this only happens on first launch after installing the app
Expected Results:
No crash
Relevant Code:
Inside Application
onCreate
Launching Activity