如何在点击键盘上的“完成”时避免调用ExpandableListView中的getChildView。

huangapple go评论73阅读模式
英文:

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.

huangapple
  • 本文由 发表于 2020年4月3日 22:36:41
  • 转载请务必保留本文链接:https://go.coder-hub.com/61014268.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定