软键盘显示/隐藏使网格视图适配器多次获取视图调用



我有两个片段:FragmentA,FragmentB。

FragmentA 包含一个 GridView,使用 BaseAdapter 子类作为适配器。

FragmentB包含一个EditText,它将在焦点时调出软键盘。

通过按下 FragmentA 的 GridView 的一个网格,使用 FragmentTransaction 将 FragmentB 添加到活动中。

问题来了,当键盘在 FragmentB 中显示/隐藏时,FragmentA 适配器的 getView 方法将被多次调用,传递位置:0,导致性能不佳。

所以任何人都可以解释为什么?

这是适配器的正常行为。https://groups.google.com/forum/#!topic/android-developers/TErt3iL-RZQ

最新更新