Caused By: Java.lang.illegalstateexception: You Need To Use A Theme-appcompat

29.10.2019
Caused By: Java.lang.illegalstateexception: You Need To Use A Theme-appcompat Rating: 5,9/10 647 votes

Instead of Theme.AppCompat, you may also use any descendant (as the crash-log suggests) of the theme like Theme.AppCompat.Light. Re: 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) AndroidYou need to use a Theme.AppCompat theme on AlertDialog creation; Android Problem Highlights 28 You need to use a Theme AppCompat theme or; 3. Create an Awesome theme, you only need to master the following skills; Android Theme.AppCompat, you should be familiar with the color properties. Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descend 06-13 阅读数 335 android开发中碰到的错误,之前开发也有碰到,今天记录下 在我们新创建的项目中或者有修改相关的配置文件,最容易出现这个问题,他的意思很简单就是你当前使用的皮肤.

  1. Caused By Java.lang.illegalstateexception You Need To Use A Theme.appcompat Theme

Caused By Java.lang.illegalstateexception You Need To Use A Theme.appcompat Theme

Visual fullscreen(25)Android Studio 0.4.5Android documentation for creating custom dialog boxes:If you want a custom dialog, you can instead display an Activity as a dialog instead of using the Dialog APIs. Simply create an activity and set its theme to Theme.Holo.Dialog inthe manifest element: However, when I tried this I get the following exception: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activityI am supporting the following, and I can't using something greater than 10 for the min: minSdkVersion 10targetSdkVersion 19In my styles I have the following. Min sdk is 10. ActionBar is available from api level 11. So for 10 you would be using AppCompat from the support library for which you need to use Theme.AppCompat or descendant of the same.Use android:theme='@style/Theme.AppCompat' Or if you dont want action bar at the top android:theme='@style/Theme.AppCompat.NoActionBar'More info @Edit:I might have misread op post.Seems op wants a Dialog with a Activity Theme.

Caused By: Java.lang.illegalstateexception: You Need To Use A Theme-appcompat

So as already suggested by Bobbake4 extend Activity instead of ActionBarActivity.Also have a look @ Dialog Attributes in the link below. The reason you are having this problem is because the activity you are trying to apply the dialog theme to is extending ActionBarActivity which requires the AppCompat theme to be applied.Update: Extending AppCompatActivity would also have this problemIn this case, change the Java inheritance from ActionBarActivity to Activity and leave the dialog theme in the manifest as it is, a non Theme.AppCompat valueThe general rule is that if you want your code to support older versions of Android, it should have the AppCompat theme and the java code should extend AppCompatActivity. If you have.an activity that doesn't need this support, such as you only care about the latest versions and features of Android, you can apply any theme to it but the java code must extend plain old Activity.NOTE: When change from AppCompatActivity (or a subclass, ActionBarActivity), to Activity, must also change the various calls with 'support' to the corresponding call without 'support'. So, instead of getSupportFragmentManager, call getFragmentManager. This Solved my problemIn manifest my activity: In style under 'AppTheme' name:.

Comments are closed.