Actionbar IllegalStateException

김토끼·2021년 10월 6일
0

java.lang.RuntimeException: Unable to start activity ComponentInfo{[package]/[activity]}: java.lang.IllegalStateException: This Activity already has an action bar supplied by the window decor. Do not request Window.FEATURE_SUPPORT_ACTION_BAR and set windowActionBar to false in your theme to use a Toolbar instead.

Caused by: java.lang.IllegalStateException: This Activity already has an action bar supplied by the window decor. Do not request Window.FEATURE_SUPPORT_ACTION_BAR and set windowActionBar to false in your theme to use a Toolbar instead.


ActionBar가 이미 세팅 되어 있는데 또 세팅했을 때 발생하는 에러.

style에 Theme.MaterialComponents.Light.NoActionBar (혹은 Theme.Appcompat.Light.NoActionBar)를 상속받아 테마 지정을 해놨는데도 해당 이슈가 발생한다면 프로젝트 생성시 ㅎ마께 생성된 다크테마 스타일 때문일 수 있다.

라이트테마일땐 정상이고 다크테마일때만 오류가 나는지 확인해보자.

profile
방구석 김토끼🐰

0개의 댓글