Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
Tags
- onMeasure
- CoordinatorLayout
- CollapsingToolbarLayout
- kotlin
- View
- room
- lifecycle
- BOJ
- Coroutine
- hilt
- 알림
- AppBarLayout
- recyclerview
- notification
- CustomView
- sqlite
- Algorithm
- 코틀린
- ViewModel
- 백준
- 안드로이드
- Android
- Behavior
- onLayout
- HTTP
- DataBinding
- Navigation
- LiveData
- activity
- 알고리즘
Archives
- Today
- Total
목록RecyclerView Adapter (1)
개발일지
Android in A..Z - RecyclerView (setHasStableIds)
setHasStableIds Adapter에 Item들이 고유한 ID값을 가진다고 Adapter에 설정하는 함수이다. setHasStableIds 설정을 통해 ViewHolder에 onBindViewHolder를 필요할 때만 호출하여 불필요한 리소스를 아낄 수 있다. ToDoAdapter setHasStableIds를 사용하면 getItemId를 구현해야한다. 또한 getItemId는 고유한 id를 리턴하도록 설정해야하며 중복된 id가 있을경우 Exception을 발생시킨다. class ToDoAdapter : BaseAdapter(ToDoItemCallback()) { init { setHasStableIds(true) } override fun onCreateViewHolder(parent: View..
Android (안드로이드)/RecyclerView
2021. 1. 10. 18:09