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

Android

Can't get rid of title bar...tried everything

Hi, I'm having the problem where any theme I put into the manifest causes my app to crash upon running, even though the code has no errors. I need to achieve the look of Theme.Black.NoTitleBar.Fullscreen, but nothing works for some reason. I tried going to styles.xml and typing the recommended phrases, and the "windowFullscreen" got rid of the status bar (clock, etc.), but nothing (including "windowNoTitle") will get rid of the title. I've tried everything I can think of for like five hours, but still the title remains. Any help would be greatly appreciated. Thanks

4 Answers

Ben Jakuben
STAFF
Ben Jakuben
Treehouse Teacher

This is a recent problem introduced by tools changes. I'm very sorry for the confusion! I posted notes in the Teacher's Notes section on that video (pasted below) and am going to refresh this course next as it suddenly became quite dated with the latest Tools changes.


Theme Error: The Android tools have been updated and the theme we use, Theme.Black.NoTitleBar.Fullscreen, may no longer work for you. If you run the app and get an error, you need to use the following workaround:

**Download files if you want to use these as replacements or for copy/paste: styles.xml | activity_main.xml

1) Change your project back to using "AppTheme" like it was before.

2) Add the following two lines to the file res/values/styles.xml(inside the <style name="AppTheme"> tag):

<item name="android:windowNoTitle">true</item>
<item name="android:windowFullscreen">true</item>

3) Set the background color to black in the file res/layout/activity_main.xml. The root element, RelativeLayout, is the one that makes up the whole screen. Add this line after the layout_height line but before the closing angle bracket >:

android:background="@android:color/black"

Interesting change indeed.

Did your SDK install correctly. It may have something to do with the file being corrupted (just an idea).

Can you post your stack trace (crash log from inside of Eclipse)? It will usually be in red color.

This video is a bit dated, but it should help. https://www.youtube.com/watch?v=2AHJsRKa_J8

A stack trace is extremely useful when debugging applications. Learn more here: http://stackoverflow.com/questions/3988788/what-is-a-stack-trace-and-how-can-i-use-it-to-debug-my-application-errors

I agree with Nicholas, try do update everything. There is a video in the Android Track that teaches how to update all your tools. Im not sure if it is in the Blog Reader App Project or In the Self Destructing Message Project.