Home > Android Error > Android Error You Need To Use A Theme.appcompat

Android Error You Need To Use A Theme.appcompat

That should work. Join them; it only takes a minute: Sign up ActionBarCompat: java.lang.IllegalStateException: You need to use a Theme.AppCompat up vote 95 down vote favorite 21 I am getting a RuntimeException on Android Join them; it only takes a minute: Sign up How can I fix this error: You need to use a Theme.AppCompat theme (or descendant) with this activity up vote 1 down The only system images I have are android-20 and android-21 Steps to reproduce: 1. this content

Select "Blank Activity" and click Next 7. Bobbake4 got it right. Nothing is going to magically apply Theme.Styled to an activity. This did it for me. –binnyb Jun 7 at 18:12 Worked well! http://stackoverflow.com/questions/21814825/you-need-to-use-a-theme-appcompat-theme-or-descendant-with-this-activity

try this : new android.support.v7.app.AlertDialog.Builder(this) share|improve this answer edited Apr 12 at 16:30 Wai Ha Lee 3,982102539 answered Mar 4 at 4:32 Mansoor Cool 31 2 That's not related to Not sure if I need to change something about extends AppCompatActivity.. Remove the android:theme line from the tag. –cryptochronoconolite Feb 16 '14 at 18:00 1 Doing this will remove the error but not get him to where he wants to Change to Theme.AppCompat causes other error up vote 21 down vote favorite 1 I use appcompat v22.1.0 in my App and use Toolbar.

After the gradle sync, Its working again and the exception went away. Multiplication Formatting Does the wifi hump affect aerodynamics or efficiency? What should I do about this security issue? Creating arrows based on GPS velocities to show displacment Goodness Giza Golf!

Unfortunately, I do not use android:launchMode="singleTask". –acrespo Feb 16 at 20:16 add a comment| up vote 1 down vote I just get my application move from ActionBarSherlock to ActionBarCompat. in Module0Error:-java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity Hot Network Questions Where are my downvotes? run(ZygoteInit.java:878) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:636) at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity. http://stackoverflow.com/questions/30180052/you-need-to-use-a-theme-appcompat-theme-or-descendant-with-this-activity-chan more stack exchange communities company blog Stack Exchange Inbox Reputation and Badges sign up log in tour help Tour Start here for a quick overview of the site Help Center Detailed

Just want to say thank you so much again for your time! Zeroes of a not quite holomorphic (but random if helpful) function Sample a random non-decreasing sequence Can I brine meat after cooking it? at android.support.v7.app.AppCompatDelegateImplBase.onCreate(AppCompatDelegateImplBase.java:113) at android.support.v7.app.AppCompatDelegateImplV7.onCreate(AppCompatDelegateImplV7.java:146) at android.support.v7.app.AppCompatDialog.(AppCompatDialog.java:47) at android.support.v7.app.AlertDialog.(AlertDialog.java:92) at android.support.v7.app.AlertDialog$Builder.create(AlertDialog.java:882) at com.ramabmtr.map.findingmoo.MainActivity.onOptionsItemSelected(MainActivity.java:216) at android.app.Activity.onMenuItemSelected(Activity.java:2572) at android.support.v4.app.FragmentActivity.onMenuItemSelected(FragmentActivity.java:353) at android.support.v7.app.AppCompatActivity.onMenuItemSelected(AppCompatActivity.java:144) at android.support.v7.internal.view.WindowCallbackWrapper.onMenuItemSelected(WindowCallbackWrapper.java:99) at android.support.v7.internal.view.WindowCallbackWrapper.onMenuItemSelected(WindowCallbackWrapper.java:99) at android.support.v7.internal.app.ToolbarActionBar$2.onMenuItemClick(ToolbarActionBar.java:74) at android.support.v7.widget.Toolbar$1.onMenuItemClick(Toolbar.java:164) at android.support.v7.widget.ActionMenuView$MenuBuilderCallback.onMenuItemSelected(ActionMenuView.java:740) at android.support.v7.internal.view.menu.MenuBuilder.dispatchMenuItemSelected(MenuBuilder.java:802) at java.lang.RuntimeException: Unable to start activity ComponentInfo{com.txt2lrn.www/com.txt2lrn.www.LandingActivity}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.

How to perform a flat spin? https://teamtreehouse.com/community/need-to-use-a-themeappcompat-theme-or-descendant-with-this-activity Nov 2 '15 at 6:05 | show 1 more comment 10 Answers 10 active oldest votes up vote 93 down vote If you are extending ActionBarActivity in your MainActivity, you will Last updated: June 3 2016 If you get an Android “IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity,” the image (from this link) shows the root In my 4.4.4 emulator (Genymotion Galaxy S5) the under bars look like a bold black line.

E/AndroidRuntime: at android.support.v7.app.AppCompatDialog.setContentView(AppCompatDialog.java:76) 11-02 04:36:55.941 24352-24352/? http://missioncritiallinux.com/android-error/android-error-android-process-acore.html Why don't my users have separate desktops in Windows 10? When I run the project i get this in my logcat java.lang.RuntimeException: Unable to start activity ComponentInfo{apps.elitehive.com.crystalball/apps.elitehive.com.crystalball.MainActivity}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity. In my 5.0.0 emulator (Genymotion Nexus 5) the under bars look correct.

android:theme="@style/Theme.AppCompat" /> This will add actionbar in activty(or all activities if you added this theme to application) But usually you need to customize you actionbar. If you have an activity that doesn't need an action bar (like a dialog themed activity) you can apply any theme to it but the java code must extend plain old Why is nuclear waste more dangerous than the original nuclear fuel? http://missioncritiallinux.com/android-error/android-error-retrieving-parent-for-item-theme-appcompat-light.html You need to declare your activities -- or your whole application -- is using Theme.Styled, e.g., : share|improve this answer answered Aug 5 '13 at 18:08 CommonsWare

onCreate(ActionBarActivityDelegateBase.java:139) at android.support.v7.app.ActionBarActivity.onCreate(ActionBarActivity.java:123) at com.code2care.example.abc.Details.onCreate(Details.java:24) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1615) ... 11 more I have an Activity A which on a button click displays an Activity B on dialog, and the theme Sorry for my English share|improve this answer edited Nov 25 '13 at 13:10 answered Nov 25 '13 at 13:04 molokoka 995815 nailed it! Why was FDR pro-intervention?

share|improve this answer answered May 3 '15 at 22:10 JonasOliveira 276211 add a comment| up vote 10 down vote I was experiencing this problem even though my Theme was an AppCompat

share|improve this answer answered Jan 14 '15 at 21:37 k29 1,2801913 1 Robolectric is throwing a NullPointerException at the setTheme line when trying to load the resource. I was in the process of mavenizing my android build. The former causes visible double window frame for alert dialogs on platforms prior to Lollipop. –Eugen Pechanec May 12 '15 at 7:10 in my case i replace the parent Thanks for you effort anyway, you have given useful advice.

What did I try to do to you? Just putting this here in case other answers don't work for some people. It was extremely helpful! http://missioncritiallinux.com/android-error/android-error-processing-com-google-maps-api-android-lib6.html new AlertDialog.Builder(this) would be fine as well because it reads alertDialogTheme attribute. –Eugen Pechanec May 12 '15 at 7:09 add a comment| 7 Answers 7 active oldest votes up vote 37

In that case this fix will not work for you. –k29 Feb 26 '15 at 21:36 add a comment| up vote 13 down vote go to your styles and put the