Description
ViewModel's onCleared() method is not called when the bottom sheet is closed with the hardware back button or with popBackStack().
If it's closed by tapping outside of the bottom sheet dialog onCleared() gets called.
Steps to reproduce
Open bottom sheet dialog
Press the hardware back button
Expected behavior
ViewModel's onCleared() method is called
Description ViewModel's
onCleared()
method is not called when the bottom sheet is closed with the hardware back button or withpopBackStack()
. If it's closed by tapping outside of the bottom sheet dialogonCleared()
gets called.Steps to reproduce
Expected behavior ViewModel's
onCleared()
method is calledAdditional context