The PR below shows changes in the recipient selection screen for sending a document. After the update, problems appeared that manifest when rotating the device and reopening the screen. A code review is needed to find independent defects in the changed code.
id.configuration changes and, after Activity recreation, be restored from SavedStateHandle.id.Activity instance must be active.Bob.For reference, the following scenario can be used in Activity:
1) onCreate -> bindConfirm { viewModel.confirm() }
2) tapRecipient("2")
3) recreate activity
4) press confirm
5) finish and open a new activity instance twice
6) press confirm once
ViewModel state.id, not the default value.androidx.activity:activity-ktx:1.9.2androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.4androidx.lifecycle:lifecycle-viewmodel-savedstate:2.8.4org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.1Activity + ViewModel, without Compose and without FragmentRecipientsScreen.bindConfirm stores one global callback until explicit unbindConfirm()Use line comments to explain the problem, its impact, the fix and how to test it.