Double Click OnClickListener of a Recycler View Adapter

浪子不回头ぞ 提交于 2019-12-04 04:22:29

So I found the issue. The following two tags were the culprits here

android:focusable="true"
android:focusableInTouchMode="true"

When we set focusable and focusableInTouchMode = true basically it means that you are enabling a view to first focus on a touch and then be able to click.

kykrueger

I had a similar problem, but the solution of setting focusable to false did not work in my case.

Instead, my problem was what I had set the onItemTouch listener in the activity that was holding my recycler view.

recyclerView.addOnItemTouchListener(...);

By removing this from my activity, my other touch listeners started to respond on single taps and not only double.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!