i am building an earthquake report app and getting this error. I searched all over Google + Stack OverFlow + udacity forums still didnt find the answer.
the error says String can't be converted into int .But I have used the exact code as mentioned in udacity.
enter image description here
The error says:
getMagnitudeColor(int) in EarthquakeAdapter cannot be applied to (java.lang.String)
Is it possibly because the JSON element that you are referencing has the number as a String datatype rather than an Integer? If so, you can fix it with the following:
int magnitudeColor = getMagnitudeColor(Integer.parseInt(currentEarthquake.getMagnitude());