英文:
How to avoid getChildView in ExpandableListView getting called when clicking on done in keypad
问题
我在ExpandableListView的一个子项中有一个EditText。在EditText中,当点击键盘上的完成按钮时,会自动调用getChildView方法。如何避免这种情况发生。同时,我想知道为什么会不必要地调用getChildView方法。请有人帮我找出原因。
英文:
I have Edittext in one of the child in ExpandableListView. In EditText when clicking on done button in keypad, getChildView is getting called automatically.How to avoid that. Also I want to know why getChildView is getting called unnecessarily.Anybody help me to find out.
答案1
得分: 0
我的猜测是:KeyEvent.KEYCODE_ENTER 事件被发送到了你的 ExpandableListView,如果是这样的话,调用 getChildView 是很正常的。
如果你想避免这种情况,可以重写监听器或者让 ExpandableListView 失去焦点。
英文:
My guess would be that the event: KeyEvent.KEYCODE_ENTER is sent to your ExpandableListView, in that case, calling getChildView is pretty normal.
If you want to avoid that just overwrite the listener or make ExpandableListView lose focus.
专注分享java语言的经验与见解,让所有开发者获益!
评论