안드로이드/안드로이드 디버깅 (11) 썸네일형 리스트형 [디버깅] 두 개의 프래그먼트에서 동시에 LiveData를 Observing 하는 경우 데이터는 잘 가져와지지만 UI 레이아웃 할 때 문제가 생기는 것 같다. 따라서, Livedata observing을 적절히 해제 해주어야 한다. 혹은 onActivityCreate에서 선언하면 lifecyclerOwner가 스스로 컨트롤 한다. //Fragment 1 override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) recycler_view.adapter = RecordTodayAdapter(requireContext(), viewModel) ... } override fun onActivityCreated(savedInstanceState: Bun.. [디버그] RecyclerView 실제 데이터와 View가 맞지 않는 문제 문제점 요약 bind 함수에서 if문에서만 뷰 갱신을 진행하는 경우, 리사이클러뷰는 뷰를 재활용하기 때문에 이전에 있던 값이 그대로 남아있다. 기존 코드의 경우 if문만 존재한다. 이때 뷰가 재활용 될 경우, 이전 뷰의 count값이 그대로 남아있어 문제가 된다. RecyclerView adapter taking wrong values I have a RecyclerView which shows two kinds of Views one represents an User publication and another that represents an Event publication. Both have elements in common, for example a TextView that s... stackove.. [디버깅] ClassNotFoundException: Dex file '/data/app,...' 앱 실행 시 메인 액티비티에 대해 ClassNotFoundException이 발생하는 오류이다. Manifest의 액티비티명, 패지키명도 제대로 작성되어 있고 해당 오류가 발생한다면, 앱 단위의 build:gradle에 다음 컴파일 옵션을 추가해준다. apply plugin: 'com.android.application' android { compileSdkVersion 29 ... compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } } 이전 1 2 다음