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 a Simple Android App (2014) Improving Our Code Adding More Colors

Ajith vishwanath
PLUS
Ajith vishwanath
Courses Plus Student 295 Points

I am Getting an error like this....pls help me

Georgi Koemdzhiev
Georgi Koemdzhiev
12,610 Points

There is nothing in the link "The conversation that you requested no longer exists." Can you explain what "error" you are talking about? :)

Ajith vishwanath
Ajith vishwanath
Courses Plus Student 295 Points

Error:(Error:(21, 9) error: cannot find symbol method setContentView(int)20, 14) error: cannot find symbol method onCreate(Bundle) Error:(22, 47) error: cannot find symbol method findViewById(int) Error:(23, 48) error: cannot find symbol method findViewById(int) Error:(24, 64) error: cannot find symbol method findViewById(int) Error:(18, 5) error: method does not override or implement a method from a supertype Error:Execution failed for task ':app:compileDebugJavaWithJavac'.

Compilation failed; see the compiler error output for details.

6 Answers

Georgi Koemdzhiev
Georgi Koemdzhiev
12,610 Points

I see. All of these methods (in red) are methods that are part of the "Activity" class so you need to extend it instead of extending Color. I would suggest extending Activity and creating separate class called "Color" and than using it into this class "MyProject" by creating an instance of the class Color there.

I hope that clears up the picture :p

Ajith vishwanath
PLUS
Ajith vishwanath
Courses Plus Student 295 Points

Im sorry I cant get u properly....this is my first android app ...so I'm a little slow...can you explain me more precisely.

Georgi Koemdzhiev
Georgi Koemdzhiev
12,610 Points

Ok, so you need to do the following in order to get rid of these error:

change this line "public class MyProject extends Color" to "public class MyProject extends Activity". That will fix this red bits, which are the methods of class "Activity". The Color that you want to use will be in the ColorWheel and I can see that you have an instance if the class already in MyProject, so you dont need "Color".

Hope that helps.

Ajith vishwanath
PLUS
Ajith vishwanath
Courses Plus Student 295 Points

Thanks a lot....that was helpful...but now im having problem with "R"...after alteration im having the same red "R",...what to do...can u guide me..

Georgi Koemdzhiev
Georgi Koemdzhiev
12,610 Points

Try: Build -> Clean Project and than Build -> Rebuild Project :)

Ajith vishwanath
PLUS
Ajith vishwanath
Courses Plus Student 295 Points

I have sent an email to you regarding the problems in gmail....please send me a solution