PhotoEditActivity orientation change issues
When changing rotation, the filters are not applied anymore. Clicking the reset button makes the activity crash.
The immediate cause is a misunderstanding on how FragmentStateAdapter
works: fragments are re-created on rotation, but the old fragments are re-used by FragmentStateAdapter
.
Ideally, PhotoEditActivity should be re-worked to use a ViewModel etc, and the mess of the different ways of callbacks should be re-worked.
As an intermediate fix, look into fixing how FragmentStateAdapter is used?