I am having some problems with my code. I have to read using JSONParser and I get this underlining on my code and it says that the problem is that i need try/catch clause but when I add the whole code is underlined and it says I have to do something with my api code.
Here is my code:
public void onResponse(JSONObject response){
JSONArray quest=response.getJSONArray("students");
for(int i=0;i<quest.length();i++){
JSONObject question=quest.getJSONObject(i);
String name=question.getString("name");
String q=question.getString("question");
label.append(name+" asked "+ q);
}
}
Thank you!