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,602 Points

Could you elaborate? What code did you put in?

Linda de Haan
Linda de Haan
11,221 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.

Dennis Kumar
Dennis Kumar
2,047 Points

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