Clear focus when the Activity stops (#1401)

This commit is contained in:
David Perez 2024-05-29 17:27:16 -05:00 committed by Álison Fernandes
parent 86e9a9df8a
commit c96ba82f4b

View file

@ -85,6 +85,13 @@ class MainActivity : AppCompatActivity() {
)
}
override fun onStop() {
super.onStop()
// In some scenarios on an emulator the Activity can leak when recreated
// if we don't first clear focus anytime we exit and return to the app.
currentFocus?.clearFocus()
}
private fun observeViewModelEvents() {
mainViewModel
.eventFlow