英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论