Clear focus when the Activity stops (#1401)

This commit is contained in:
David Perez
2024-05-29 17:27:16 -05:00
committed by GitHub
parent 5c1a20e6c6
commit f43a8c8ab4

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