How do I get the position selected in a RecyclerView?

前端 未结 13 2479
自闭症患者
自闭症患者 2020-11-27 04:40

I am experimenting with the support library\'s recyclerview and cards. I have a recyclerview of cards. Each card has an \'x\' icon at the top right corner to remove it:

13条回答
  •  再見小時候
    2020-11-27 04:47

    Get focused child, and use it to get position in adapter.

    mRecyclerView.getChildAdapterPosition(mRecyclerView.getFocusedChild())
    

提交回复
热议问题