ParkSangGwon / TedPermission

Easy check permission library for Android Marshmallow
1.74k stars 238 forks source link

AppCompat Theme 오류 #39

Closed CyranoBaek closed 7 years ago

CyranoBaek commented 7 years ago

안녕하세요? 질문이 있어서 올립니다. 에러 로그는 아래와 같습니다. Unable to start activity ComponentInfo{com.myapp/com.gun0912.tedpermission.TedPermissionActivity}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.

tedpermission을 하는 Activity에서는 별도로 AppCompat를 사용하지 않는데 에러코드가 뜹니다. 어떻게 해결하면 좋을까요? 답변 부탁드리겠습니다.

BoxResin commented 7 years ago

AppCompat 테마를 사용하지 않아서 발생하는 오류로 보이는데, styles.xmlAppTheme 스타일을 AppCompat 계열 테마로 지정하셨나요?

CyranoBaek commented 7 years ago

tedpermission을 호출하는 Activity에서는 AppCompat 계열 테마를 사용하지 않았습니다.

ParkSangGwon commented 7 years ago

@CyranoBaek AppCompat테마를 사용하시길 추천드립니다. 만약 사용하지 않으신다면 theme에 아래 내용을 추가해보세요

 <item name="windowActionBar">true</item>

예)

<resources>

    <!--
        Base application theme, dependent on API level. This theme is replaced
        by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
    -->
    <style name="AppBaseTheme" parent="android:Theme.Light">
        <!--
            Theme customizations available in newer API levels can go in
            res/values-vXX/styles.xml, while customizations related to
            backward-compatibility can go here.
        -->
    </style>

    <!-- Application theme. -->
    <style name="AppTheme" parent="AppBaseTheme">
        <item name="windowActionBar">true</item>
        <!-- All customizations that are NOT specific to a particular API-level can go here. -->
    </style>

</resources>