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 trialXaralampos Kanellopoulos
5,567 PointsApp 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/
2 Answers
Peter Price
4,007 PointsHi 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.
Xaralampos Kanellopoulos
5,567 PointsThnx my friend :)
Andrew Wiley
27,097 PointsIf 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
Xaralampos Kanellopoulos
5,567 PointsXaralampos Kanellopoulos
5,567 PointsI fixed it by commenting //getSupportActionBar().setDisplayHomeAsUpEnabled(true); in StoryActivity any idea why this was a fault? Thnx