# Two Bugs, One Setting: How DKA Silently Broke Our Fragments

- **Source:** [ProAndroidDev - Medium](https://brifing.si/source/d9553fa9-7b72-4b9b-bc73-c6bf9a40dd5f)
- **Published:** 2026-08-11
- **Topic:** [Software & Engineering](https://brifing.si/c/engineering)
- **Original article:** <https://proandroiddev.com/two-bugs-one-setting-how-dka-silently-broke-our-fragments-de9567449e6c?source=rss----c72404660798---4>
- **On Brifing:** https://brifing.si/s/379e76a8-103e-4c8d-af8d-7a917001865a

## DKA and Fragment Recreation

The DKA (Don't Keep Activities) option in Android Developer Options causes the system to destroy an activity when the user navigates away from it. Fragments are also destroyed, but ViewModels are retained by ViewModelStore. When the activity is recreated, the fragment is re-instantiated while the ViewModel is reused. This results in custom onCreate-like methods tied to the ViewModel lifecycle not running again.

## onCreateFeature in MVI Architecture

In MVI architecture, there is a method called onCreateFeature(bundle, savedState) similar to ViewModel.onCreate(). This is where the feature engine, reducer, and all delegates are created. onCreateFeature runs exactly once when the ViewModel is first created. When the fragment is recreated and the ViewModel is reused, onCreateFeature does not run again. This means that everything initialized in the previous fragment instance remains intact.

## Sources covering this story

- https://proandroiddev.com/two-bugs-one-setting-how-dka-silently-broke-our-fragments-de9567449e6c?source=rss----c72404660798---4 — 

---

_Summary written by Brifing from the original reporting. Copyright in the original article belongs to its publisher; read the full piece at the link above._
