본문 바로가기

Debbi Story

검색하기
Debbi Story
프로필사진 Debbi

  • 분류 전체보기 (38)
    • 일상 (0)
    • mac 사용 tip (3)
    • 안드로이드 (28)
      • Plugins (3)
      • Jetpack (2)
      • Tip (19)
      • WebView (1)
      • PlayStore (3)
    • git (2)
    • 알고리즘 연습 (2)
    • 삽질 일기 (1)
Guestbook
Notice
Recent Posts
Recent Comments
Link
«   2026/02   »
일 월 화 수 목 금 토
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
Tags
  • itemAnimator
  • ActivityResultContracts
  • prettyJson
  • ExifInterface
  • requestPermission
  • jsontokotlinclass
  • shotcut
  • 이미지 gps
  • ChromeCustomTab
  • notification bar
  • Plugins
  • navigation component
  • Blinking
  • datastore
  • 403 Error
  • notification
  • onReceivedSslError
  • webview
  • room
  • BottomSheetDialog
  • kdoc-generator
  • onResume
  • skipcollapsed
  • App Startup
  • application
  • Git
  • notification setting
  • circlecrop
  • LOG
  • Android
more
Archives
Today
Total
관리 메뉴
  • 글쓰기
  • 방명록
  • RSS
  • 관리

목록notifyDataSetChanged (1)

Debbi Story

ViewPager2의 notifyDataSetChanged() 안될 때

ViewPager2는 RecyclerView.Adapter 와 FragmentStateAdpater를 사용할 수 있습니다. 그중에 FragmentStateAdpater를 사용했을때 notifyDataSetChanged()를 해도 갱신이 안될 때 getItemId 와 containsItem 를 override 해주시면 됩니다! 아래는 예시 입니다. class ViewPager2Adapter(fm: FragmentManager, private val fmList: ArrayList) : FragmentStateAdapter(fm) { private val fmIds = fmList.map { it.hashCode().toLong() } override fun getItemCount(): Int { retur..

안드로이드/Tip 2020. 8. 18. 23:22
이전 Prev 1 Next 다음

Blog is powered by kakao / Designed by Tistory

티스토리툴바