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 Build an Interactive Story App (Retired) User Input Introducing ImageViews

AppTheme not correct by default

I did start my project and when it loads everything into the studio the default activity theme which is named APPTHEME is not with the action bar, is there any way I can download it from ?

1 Answer

Harry James
Harry James
14,780 Points

Hey Unmesh!

AppTheme is a custom theme that we define and we can give it an Action Bar if it doesn't have one already.

To do this, hop into the res >> values directory and open the styles.xml file.

I'm not going to go into the details of this file as Ben will teach you them in a bit but styles.xml allows us to customize styles for our app. Here, we have the AppTheme style that has a parent. We can customize this theme where the comment is so that we inherit properties from the parent but change some of the properties we don't want to inherit (We want to change).

You can go ahead and use this parent:

<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">

So that you have a light themed application but a dark themed action bar. Note that there's nothing we need to customize just yet so this is the only line you need to change (Line 4 by default).


Hope it helps and if you have any problems whilst doing this, give me a shout and I'll be happy to help out :)