Android RecyclerView item 개수 확인하기

사용 버전: Android Studio 4.0

사용 언어: Kotlin 1.3.72


안드로이드 RecyclerView item 개수 확인하기를 알아보겠습니다.


아이템 개수를 확인하여 보이는 페이지를 조정할 때 사용합니다.


viewModel.LiveData 이름.observe(viewLifecycleOwner, Observer {

    it.isNotEmpty() // 빈 화면이 아니라는 뜻.

    it.size // 내용물 개수를 나타냅니다.

}






끝.


카테고리: Android

댓글

이 블로그의 인기 게시물

Python urllib.parse.quote()

KiCad 시작하기 4 (기존 회로도 수정 및 추가)

Android Compose Coil library

KiCad 시작하기 1 (회로도 만들기)

Android Notification with Full Screen

iOS Swift callAsFunction

Android Custom IME(Input method editor) 만들기

iOS Error Undefined symbol Testing.Trait

Forensics .pyc 파일 .py로 복구하기

Android Compose automation for getting localized images to use on Play Store app image