How to get child view from RecyclerView?

前端 未结 11 1945
离开以前
离开以前 2020-12-24 08:18

I am trying to get child view by position. I could get view when one item is clicked:

rvSellRecords.addOnItemTouchListener(new RecyclerItemClickListener(         


        
11条回答
  •  误落风尘
    2020-12-24 09:05

    Write this method in adapter.

     public Object getItem(int position) {
            return yourArrayList.get(position);
        }
    

    and you just need to call it like

    yourAdapter.getItem(2);
    

    pass your required position. Hope it solves your problem.

提交回复
热议问题