Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.
Fun Facts Error?
I have been stuck on this video for 2 days now, My Emulator has been working and after entering the code from the video onto FunFactsActivity.java i am no longer able to run the app?I have also gone back from scratch but i still get the same results.Every time i try and launch it says Fun Facts has stopped working?
drizzy drakeCourses Plus Student 2,469 Points
is your id for factTextView TextView for your label in the xml e.g. android:id="@+id/FactTextView" and showFactButton for your Button id e.g. android:id="@+id/showFactButton"
yes it is?
Error:(30, 23) error: method setOnClickListener in class View cannot be applied to given types; required: OnClickListener found: no arguments reason: actual and formal argument lists differ in length
how do I fix this?
Ben JakubenTreehouse Teacher
You error jumped out at me when I plugged your code into my own project and tried to run it:
Do you get that kind of view about the error when you run it?
In this case, it can't find the ID
showFactButton. That's because the ID in your layout file has a capital "S":
ShowFactButton. Try switching that to lowercase and see if you can now run your app. :)
Thank You Ben, it worked!It took me 2 days and it was as simple as a lower case letter! Thanks Again.