๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

๋นˆ ๊ตฌ๋ฉ ์ฑ„์šฐ๊ธฐ

[Android] RecyclerView.Adapter ์•ˆ click listener ์œ„์น˜

androidessence.com/recyclerview-vs-listview

 

RecyclerView VS ListView

Understanding what the difference is between a RecyclerView and a ListView.

androidessence.com

stackoverflow.com/questions/33845846/why-is-adding-an-onclicklistener-inside-onbindviewholder-of-a-recyclerview-adapt

 

Why is adding an OnClickListener inside onBindViewHolder of a RecyclerView.Adapter considered bad practice?

I have the following code for a RecyclerView.Adapter class and it works fine: public class MyAdapter extends RecyclerView.Adapter { private List...

stackoverflow.com

 

๋ทฐํ™€๋” ์ƒ์„ฑ์ž ์•ˆ์—์„œ๋‚˜ onCreateViewHolder ์•ˆ์—์„œ click listener ์…‹์—…ํ•˜๊ธฐ.

onBindViewHolder()์—์„œ ์…‹์—…ํ•˜๊ณ  ์‹ถ์€ ์œ ํ˜น์„ ๋ฟŒ๋ฆฌ์น˜๊ธฐ ์œ„ํ•ด ๊ธฐ๋กํ•œ๋‹ค.