We minimize the application, the activity is unloaded from memory, we return to the application and crash (it was not possible to recreate the data from the constructor). Is it possible to transfer the listener through the bundle? (So that it is recreated along with the activity)
code example:
class MyBottomSheetDialogFragment (
val data: Data,
val clickListener: () -> Unit
) : BottomSheetDialogFragment() {
//using clickListener
}
MyBottomSheetDialogFragment({
//clicked listener lambda
}).show(fragmentManager, "tag").show()