개발자는 항상 사용자 관점에서 앱을 개발해야 합니다. 언제든지, 저희가 만드는 앱을 사용하다가 불편한 점을 발견하면 공유해주세요! ⭐
[Android] Multi-View Type을 지원하는 RecyclerView 구현하기
Sealed class로 RecyclerView Multi View Type 때려 부수기 | 매쉬업 안드로이드 개발자
Activity가 파괴되어 재생성될 때 Fragment도 재생성된다. 이 때 Fragment는 기본 생성자를 사용하여 생성하게된다.
val fragment = MypageFragment()
이와 같이 프래그먼트 객체 생성 시 아래와 같은 에러를 볼 수도 있다.
Unable to instantiate fragment MypageFragment: make sure class name exists, is public, and has an empty constructor that is public
newInstance()를 사용하는 이유