机器人(棒棒堂)的EditText的onfocus发射多次 [英] Android (Lollipop) EditText onFocus fired multiple times

查看:297
本文介绍了机器人(棒棒堂)的EditText的onfocus发射多次的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有onFocusChangeListeners几个EditTexts的

I have a couple of EditTexts with onFocusChangeListeners

// When the field gains or loses focus
txtMinimumValue.setOnFocusChangeListener(new View.OnFocusChangeListener() {
    @Override
    public void onFocusChange(View view, boolean hasFocus) {
        editFocusChange(view, hasFocus);
    }
});

我并没有在pre-棒棒糖设备的任何问题,但任何Nexus 5的和onFocusChange被激发约7倍。

I'm not having any issues on pre-Lollipop devices, but any Nexus 5's and the onFocusChange is fired about 7 times.

我发现这太:<一href=\"http://stackoverflow.com/questions/27100534/custom-listadapter-consisting-of-edittext-lose-focus-called-twice\">Custom组成的EditText的ListAdapter失去焦点叫了两声

然后我发现,看起来这个有关Android的开源问题:的 HTTPS://$c$c.google.com/p/android/issues/detail ID = 80180
项目成员说,该框架版本则这一点。修正了在将来的版本。反正知道,当应用程序兼容性-V7:21.0.3被释放,我可以测试是否该修正了我的问题。

and then I found this Android Open Source Issue that looks related: https://code.google.com/p/android/issues/detail?id=80180 A Project Member said, "The framework version does this too. Fixed for a future release." Anyway to know when appcompat-v7:21.0.3 is released and I can test if this fixes my issue?

任何人有同样的问题?

推荐答案

我有无数的滤网,我可能对顶部和编辑框多个视图,然后值在的ListView <列表/ code>。我一直在动态建立价值观的底部列表视图从数组,然后编程的方式构建视图的顶部,并添加此顶部为标题视图。这是为了让整个屏幕滚动在一起,B / C,你应该在的ListView 不添加到滚动型

I have numerous filter screens where I might have several views on top and edit boxes, and then a list of values in a ListView. I've been dynamically building the bottom list view of values from arrays, and then programmatically building the top section of views and adding this top section as a header view. This is so the entire screen scrolls together, b/c you shouldn't add a ListView to a ScrollView.

在顶部的任何的EditText 的意见可能有 onFocusChange 方法调整手动输入的过滤器值。在棒棒糖,必须有而这些编程内置的看法添加为的ListView中的错误头不工作,二/三 onFocusChange 方法进行多次射击。我必须建立顶部作为 onFocusChange 方法的XML来正确地触发。

Any EditText views on the top section might have onFocusChange methods to adjust the filter values manually entered. On Lollipop, there must be a bug where these programmatically built views added as a ListView header don't work, b/c the onFocusChange methods were firing repeatedly. I had to build the top as an xml for the onFocusChange methods to fire correctly.

这篇关于机器人(棒棒堂)的EditText的onfocus发射多次的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆