Change theme
Help
Press space for more information.
Show links for this issue (Shortcut: i, l)
Copy issue ID
Previous Issue (Shortcut: k)
Next Issue (Shortcut: j)
Sign in to use full features.
Vote: I am impacted
Notification menu
Refresh (Shortcut: Shift+r)
Go home (Shortcut: u)
Pending code changes (auto-populated)
View issue level access limits(Press Alt + Right arrow for more information)
Unintended behavior
View staffing
Description
Discovered reason:
When a new instance of BiometricPrompt is created, it adds a LifecycleObserver to the Activity and never removes it. So when you have multiple instances of BiometricPrompt in an Activity, there are multiple LifecycleObservers. The first only receives callbacks.
Similar issue, detailed explanation of the reason and solution with Reflection I have found here:
The solution with Reflection fixes my issue, however, I think it is not the best work around:
"You should remove LifecycleObserver from activity when you create a new instance of BiometricPrompt class. Since there is no direct access to the observer, you need use reflection here"
So, could you, please, fix it, or suggest me a better way to handle it?
BUILD INFO
- Device type: Samsung Galaxy S8 Edge, Samsung Galaxy S8, Emulator Pixel 2, Emulator Nexus 5
- OS version: Android Api level 28 and below
- Biometric library version: androidx.biometric:biometric:1.0.1
NUMBER OF TIMES YOU WERE ABLE TO REPRODUCE 10/10