I have a ListView with some focusable components inside (mostly EditText
s). Yeah, I know this isn\'t exactly recommended, but in general, almost everything is w
My answer is related to most of the answers here, but I just wanted to add that in my case, this crash occurred due to removing a row with an edit text that currently had the focus.
So all I did was override the remove method of the adapter, and queried whether the removed row contains the current focus edit and if so, clear the focus.
That solved it for me.
In case of Expandable List View, if your child items have edit text then you need to change the focusability before descendants for Expandable List View
expandableListView.setDescendantFocusability(ViewGroup.FOCUS_BEFORE_DESCENDANTS);
I faced the same problem when using EditText
in Recyclerview
. After a lot of struggle and trying different option i found out the after deleting the row when my keyboard is opened produces this issue. I solved it by force closing my keyboard and changing notifyItemRemoved(position)
with notifyDataSetChanged()
.