본문 바로가기
모바일개발(Mobile Dev)/안드로이드개발(Android)

android:style/Theme.Dialog java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendat) with this activity

by 테크한스 2016. 4. 5.
반응형

메인 에러:

you need to use a theme.appcompat theme (or descendant) with this activity


상황: 

SplashActivity를 이용하려는데  actionbar를 없애기위해


            android:theme="@android:style/Theme.NoTitleBar"


manifest에 위와 같은 코드 추가후

android support.v7.appcompat 관련 에러가 발생.



해결: 

2014 년 8 월기준  모든 라이브러리및 관련sdk를 모두 설치하였다면,  android.support.v7.appcompat 라이브러리가 있을 것임.

고녀석은 .java파일에서. extends를 Activity 가아닌 ActionBarAcivity를 가지게됨.

다음과 같이



import
 android.support.v7.app.ActionBarActivity;

public class SplashActivity extends ActionBarActivity {


고로 ActionBarAcvitivy를 Acitivy로 바꿔준다면 손쉽게 해결!



이유??

아마 저 라이브러리는 액션바가 메인인  라이브러리같은데.. hide가 안되나봄..

자세한건 조금더 살펴봐야할 듯.



*****추가 . extends를 Activity로 사용하지 않을 경우가 분명이있다.

그럴경우 해당 manifest에서 해당 activity에 다음과 같이 추가해준다

 android:theme="@style/Theme.AppCompat"

반응형