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.

Android Build a Simple Android App with Java Improving Our Code Using the New Colors

Dennis Kumar
Dennis Kumar
2,047 Points

error: array required, but int found

I put the code same as in the video but the android shows an error: array required, but int found.

How can i fix this ?

Binyamin Friedman
Binyamin Friedman
14,615 Points

Could you elaborate? What code did you put in?

Linda de Haan
Linda de Haan
12,413 Points

Without reviewing your code we can't really help you, but from what the error says, you're probably trying to return an int where the codes expects an array. I took a look at the video and he is parsing a String array with hex colors to an int. Make sure you did that correctly.

1 Answer

Dennis Kumar
Dennis Kumar
2,047 Points

Oh! It was basically I spelled my array name while parsing incorrectly. It works now. Thankyou :)