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
Dylan Cairns
11,191 Pointsaction bar navigation for extra credit
I'm trying to do the extra credit by setting up the action bar navigation for "where's my up button?" I'm trying to do it like this as google says:
ActionBar actionBar = getSupportActionBar(); actionBar.setDisplayHomeAsUpEnabled(true);
but getSupportActionBar doesn't work. Further information said that I need the class in BlogWebViewActivity to extend ActionBarActivity rather than just Activity. But if I change that then the entire project becomes one giant error. I also need to create the appcompat_7 library to import.
How do I go about adding this?
2 Answers
Connor Myers
21,089 PointsDid you try this:
ActionBar actionBar = getActionBar(); actionBar.setDisplayHomeAsUpEnabled(true);
I know in the apps i have created that I used this to get the actionBar. Not sure if it will work but it is just a suggestion.
Dylan Cairns
11,191 PointsIt did work, thank you. From what I understand now, SupportActionBar is only for older versions (v7 or below) of android SDK