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 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 :)