I'm seeing Firebase crashes in a couple of Fragments that are using EpoxyRecyclerView.withModels {...}
Stacktrace is usually as follows:
Fatal Exception: java.lang.IllegalStateException
Fragment d{4cc615e} (3fe66274-2caa-4a54-9698-137ed7497410) not attached to a context.
Code:
val epoxyRecyclerView = requireView() as EpoxyRecyclerView
epoxyRecyclerView.withModels {
someItemView {
id(item.id)
item(item)
text(getString(R.string.some_string)) // <--- this crashes
onItemClickListener { model, _, _, _ ->
...
}
}
}
I assume calling epoxyRecyclerView.clear() in Fragment's onDestroyView() will fix this issue, but that means I need to look-up a dozen Fragments and add this manually. Is there a better way?
I'm seeing Firebase crashes in a couple of Fragments that are using
EpoxyRecyclerView.withModels {...}
Stacktrace is usually as follows:
Code:
I assume calling
epoxyRecyclerView.clear()
in Fragment's onDestroyView() will fix this issue, but that means I need to look-up a dozen Fragments and add this manually. Is there a better way?Epoxy Version: '4.6.4'