Open freelanzer1 opened 3 weeks ago
Or maybe there is another solution?
Thanks for reporting the bug. I'll think about how to fix it.
@freelanzer1 I think that you can create UiRequestViewModel on new permission requests. And after clearing ViewModelStore recreate UiRequestViewModel.
Looks like a solution to the problem, what do you think, is this solution suitable?
@RadiationX It sounds good, but if it will be done automatically, inside the library and will not require improvements from library users. Please make changes to the library or describe in the documentation how to work around this problem (with examples)
@freelanzer1 Fixed in version 1.1.3. https://github.com/mintrocket/MintPermissions/releases/tag/1.1.3 Nothing extra needs to be done, just update the version.
Please check if everything works correctly?
When the ActivityViewModel is used in the project and it is necessary to perform cleanup using requireActivity().getViewModelStore().clear (), so the UiRequestViewModel terminates silently. Since this ViewModel is created from the library, users are not always aware of its existence, but the entire logic of the library is tied to it. As a result, it is not an obvious and silent bug, which leads to the refusal to all work in the library. The proposed solution is to finalize the library in terms of outputting a message to the log that the UiRequestViewModel has ended (logging to onCleared()) or indicating that after getViewModelStore().clear() it is necessary to recreate the Activity