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 trial
Sam Soffes
Treehouse Guest TeacherThemes trouble
I tried setting the theme to Theme.Black.NoTitleBar.Fullscreen but it crashes with the following error:
You need to use a Theme.AppCompat theme (or descendant) with this activity.
Googled around for awhile and couldn't figure it out. Android Studio doesn't seem to have that fancy manifest editor you used in the video (or at least I couldn't find it).
Any help would be greatly appreciated!
4 Answers
Ben Jakuben
Treehouse TeacherI just got that same problem in Android Studio last week! I got around it by bumping up my minSdkVersion because I was okay with supporting 4.0 and above.
So I just went back and tried to revert to API 9 for minSdkVersion. I changed it in both my manifest and build.gradle file. No errors. I ran it and verified it worked. Restarted Android Studio and verified it worked. It's supposed to work because Theme.Black.NoTitleBar.Fullscreen has been around since API 1.
I don't know why the error would be there and then go away by changing and then reverting the min SDK. Can you try that and see if you get the same behavior? If so, then we can chalk it up to a bug in Android Studio. If not, then we'll have to dig a little deeper.
Sam Soffes
Treehouse Guest TeacherI changed minSdkVersion to 9 in build.gradle and AndroidManifest.xml and the same thing still happens. Any other ideas?
Ben Jakuben
Treehouse TeacherI'm away from my laptop for a minute...can you try adding this line in your onCreate method (after super.onCreate)? This has worked for me before...will try shortly myself!
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
Ben Jakuben
Treehouse TeacherAlso, can you verify the syntax you're using? I sometimes still get confused as to when to use @android:style vs @style, etc. This is what I have:
<activity
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"
Kevin Chen
2,539 PointsI am running into this issue as well. Any help? Tried the above solutions and they both don't work.
Ben Jakuben
Treehouse TeacherHere's one potential solution that hides some things in code: http://stackoverflow.com/q/20653305/475217
Donald Robertson
2,189 PointsI'm also running into this issue, I've tried all of the solutions posted so far but no luck. Any other suggestions?
Ben Jakuben
Treehouse TeacherI added some notes in the Teacher's Notes section that address this issue: http://teamtreehouse.com/library/build-a-simple-android-app/pretty-little-things/adding-an-image-2