Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialThamood Binmahfooz
3,283 Pointsapp keeps crashing on the emulator after changing the theme
after i changed the theme to:
<style name="AppTheme" parent="android:Theme.Holo.Light.NoActionBar">
and running it on the emulator i kept getting this runtime error:
You need to use a Theme.AppCompat theme (or descendant) with this activity.
after looking around i found this on stack overflow:
so i changed the the Java file to extends the Activity
class instead of the ActionBarActivity
class and all went well.
i don't know if what i did was correct.
I'm using Android Studio 1.0.2 on a Mac
4 Answers
Joshua Mossop
885 PointsEasy fix, I ran into the same problem just now and decided I better share the solution. ^_^
Inside AndroidManifest.xml there is a line that says android:theme this is just calling a style from your styles.xml. So if we open up this file and change the theme to look like the following everything should work splendidly.
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
Tiffany Hsieh
201 PointsI tried this as well as all the suggested tips in the forum but it still doesn't work. It "runs" without errors but when it shows up on the emulator or my phone it immediately crashes
Charles Herrera
3,292 PointsI had the same issue
I had to change the java to public class FunFactsActivity extends android.app.Activity
It would be nice to get someone from Treehouse to address what is going on here
Rex Wang
2,089 PointsI changed mine to AppCompatActivity
as recommended by this S.O. post
kaizen rework
810 Points<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"> -- this worked for me :)
thank you
Ivan Nemchenko
6,623 PointsIvan Nemchenko
6,623 PointsThank you dear Sir! Worked like charm.
Miguel Sousa
6,872 PointsMiguel Sousa
6,872 PointsIt worked with me!
Thomas Cullen
8,433 PointsThomas Cullen
8,433 PointsYep this worked, Great stuff.