Dialog cannot keep its state after rotating screen. Most of time, we use DialogFragment to solve this problem. But it will break original-like API style (Need developers to add Fragment to FragmentManager by themselves.).
I have implemented a simple version of DialogFragment for BiometricPromptApi23Impl which is still undocumented: AbstractBiometricPromptDialogFragment. I think I should make it easier to use before releasing it.
If you have any idea, welcome to comment here.
中文:
Dialog 不能在旋转屏幕后保持它的状态。大多时候我们会使用 DialogFragment 来解决这个问题,但它会破坏类原生接口的风格(需要开发者自行将 Fragment 加入 FragmentManager)。
我已经为 BiometricPromptApi23Impl 实现了一个未记入文档的简单版本 Fragment ——AbstractBiometricPromptDialogFragment。我想我应该让它更易于使用再发布。
如果你有任何点子,欢迎在此发表评论。
Dialogcannot keep its state after rotating screen. Most of time, we useDialogFragmentto solve this problem. But it will break original-like API style (Need developers to addFragmenttoFragmentManagerby themselves.).I have implemented a simple version of DialogFragment for BiometricPromptApi23Impl which is still undocumented:
AbstractBiometricPromptDialogFragment. I think I should make it easier to use before releasing it.If you have any idea, welcome to comment here.
中文:
Dialog不能在旋转屏幕后保持它的状态。大多时候我们会使用DialogFragment来解决这个问题,但它会破坏类原生接口的风格(需要开发者自行将Fragment加入FragmentManager)。我已经为
BiometricPromptApi23Impl实现了一个未记入文档的简单版本 Fragment ——AbstractBiometricPromptDialogFragment。我想我应该让它更易于使用再发布。如果你有任何点子,欢迎在此发表评论。