Android RecyclerView item 개수 확인하기

사용 버전: Android Studio 4.0

사용 언어: Kotlin 1.3.72


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


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


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

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

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

}






끝.


카테고리: Android

댓글

이 블로그의 인기 게시물

Python OpenCV 빈 화면 만들기

Python urllib.parse.quote()

Python bytes.fromhex()

Android AVD Ram size change

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

Android Minimum touch target size

KiCad 시작하기 7 (FreeRoute 사용하기 2)

Android Notification with Full Screen

C++ OpenCV 모폴로지 침식, 팽창

KiCad 시작하기 2 (PCB 만들기)