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
Ricky Sparks
22,249 PointsAndroid Self Destruct message app has one bug/error that I can't seem to figure out for days? (Screenshot available)
Ricky Sparks
22,249 PointsHarry James
14,780 PointsAnd what are you extending in MainActivity?
Ricky Sparks
22,249 Pointspublic class MainActivity extends Activity {
*sorry for the late responses, been @ school missing the comments.
3 Answers
Harry James
14,780 PointsOkay! Thanks for your time and also I understand about the late responses (It's the same with me, I have school too!).
When extending Activity, you have no need to override the getPageTitle() method since you aren't overriding or implementing something to the method.
Basically, @Override will overwrite the method in the parent class so, the code that deals with getting the page title will not run. Java is giving you an error here because this method can not be overwritten (This is mainly a safeguard to prevent things going wrong in your code as a result).
I hope this explains it but, if you have any more questions, give me a shout! :)
Ricky Sparks
22,249 PointsSo remove the override?
Harry James
14,780 PointsYes :)
I thought I'd also include a bit of an explanation about why you got that error as well as, it's useless if I give you an answer without explaining it!
The concept of overrides can seem confusing at first but, there are plenty of comments on the internet that explain how they function.
Ricky Sparks
22,249 PointsOk thank you very much I got the explanation :D
bell just rang at school....
Harry James
14,780 PointsHarry James
14,780 PointsWhat does it say if you hover over the @Override?