I'm trying to handle the following json:
[{"code":"ARS","codein":"BRL","name":"Peso Argentino (R$)","high":"0.165","low":"0.1638","pctChange":"0.182","open":"0","bid":"0.1643","ask":"0.1647","varBid":"0.0003","timestamp":"1522699200000","create_date":"2018-04-02 20:20:08"}]
I'm using:
JSONObject json = new JSONObject(responseBody);
JSONArray dados = json.getJSONArray("NÃO EXISTE UMA KEY?");
for (int i = 0; i < dados.length(); ++i) {
JSONObject linha = dados.getJSONObject(i);
Log.v("valor", linha.getString("high"));
}
How do I do when there is no key?