마스터Q&A 안드로이드는 안드로이드 개발자들의 질문과 답변을 위한 지식 커뮤니티 사이트입니다. 안드로이드펍에서 운영하고 있습니다. [사용법, 운영진]

안드로이드 액션바 테마 변경시 앱실행 에러

0 추천

앱 초기화면(스플래시 화면) 을 보여준후 메인화면을 보여주는 동작을 만드는 중인데

앱의 액션바 테마만 건드리면 앱이 넘어가다가 에러가 납니다. 

values파일에 themes.xml 문서를 만들어서 코드를 넣어줬습니다.

<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- the theme applied to the application or activity -->
<style name="CustomActionBarTheme"
    parent="@android:style/Theme.Holo.Light.DarkActionBar">
    <item name="android:actionBarStyle">@style/MyActionBar</item>
</style>

<!-- ActionBar styles -->
<style name="MyActionBar"
    parent="@android:style/Widget.Holo.Light.ActionBar.Solid.Inverse">
    <item name="android:background">#ff5500</item>
</style>
</resources>

 

제 예상에는인트로용 화면은 Activity를  상곡하고 이후 메인은AppCompatAcitivity를 상속하는데 여기서 문제가 나거나 또는 메인이 import android.support.v7.app.AppCompatActivity 를 포함하는데 서포트를 쓸경우 다른식으로 써야되는것 같습니다. ...

익명사용자 님이 2018년 5월 18일 질문

1개의 답변

0 추천
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.his.login/com.example.his.login.MainActivity}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.

 

 Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.

 

많은 줄이 있지만 저 두줄이 눈에 가장 띕니다.
his1472 (260 포인트) 님이 2018년 5월 18일 답변
...