I would to refer to the description field in the weather array using the getDescription function
"weather": [
{
"id": 600,
"main": "Snow",
"description": "light snow",
"icon": "13d"
}
],
public String getDescription() {
String description = String.valueOf(obj.getJSONArray("weather"));
String jObj = String.valueOf(obj.getJSONObject("description"));
return jObj;
How to write correctly getDescription functions to get the description value from the Weather array?
question from:https://stackoverflow.com/questions/66067015/how-to-reference-a-json-array-using-an-api