에러
val ft = supportFragmentManager.beginTransaction()
ft.replace(
~~, ~~
).commit()
ft.replace(~~, ~~).commit()
한 번 commit이 실행된 Transaction은 다시 commit할 경우 에러가 발생함
해결
새로운 Transaction을 생성하여 commit해야 함
예)
val ft = supportFragmentManager.beginTransaction()
ft.replace(~~, ~~).commit()
ft = supportFragmentManager.beginTransaction()
ft.replace(~~, ~~).commit()
https://ddunnimlabs.tistory.com/124
Fragment 변경시 발생할 수 있는 에러. Error msg : java.lang.IllegalStateException: commit already called
이번에 업데이트 중인 앱의 UI를 변경하다가 BottomNavigationView를 사용할 일이 생겼다. BottomNavigationView를 사용하면 하단에 Tab이 있고, MainView에 Fragment가 들어가는데 Tab의 메뉴를 누르면 화면이 변..
ddunnimlabs.tistory.com
'안드로이드' 카테고리의 다른 글
[안드로이드] 자동 백업 막기 (0) | 2021.03.18 |
---|---|
[안드로이드] Error inflating class com.google.android.material.card.MaterialCardView 해결 (0) | 2021.03.15 |
안드로이드 Cannot inline bytecode built with JVM target 1.8 into bytecode that is being built with JVM target 1.6 에러 해결 (0) | 2020.08.21 |
EditText 키보드 완료 버튼 이벤트 - Kotlin (0) | 2020.06.30 |
웹 이미지 비트맵 최적화 (0) | 2020.03.25 |