Preventing/catching “IllegalArgumentException: parameter must be a descendant of this view” error

后端 未结 15 1607
北恋
北恋 2020-11-27 13:46

I have a ListView with some focusable components inside (mostly EditTexts). Yeah, I know this isn\'t exactly recommended, but in general, almost everything is w

15条回答
  •  误落风尘
    2020-11-27 14:17

    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.

提交回复
热议问题