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) Intents and Multiple Activities Adding a Second Activity

Xaralampos Kanellopoulos
Xaralampos Kanellopoulos
5,567 Points

App crashes when i press the Button

When i press the button the app crashes any idea why this is happening? The code in MainActivity is from the Project files.. I am using the latest version of Android Studio/

Xaralampos Kanellopoulos
Xaralampos Kanellopoulos
5,567 Points

I fixed it by commenting //getSupportActionBar().setDisplayHomeAsUpEnabled(true); in StoryActivity any idea why this was a fault? Thnx

2 Answers

Hi Xaralampos,

I think it might be that you have deleted all the other code for the task bar, but missed that line of code, forcing the app to crash because it didn't know what to do with it.

Andrew Wiley
Andrew Wiley
27,097 Points

If you put a name in and then press the button, you will get an error... if you dont and press the button it will work