I am getting ArrayIndexOutOfBoundsException at id[i] = c.getString(TAG_ID);
Here's the code:
for (int i = 0; i < 25; i++) {
JSONObject c = contacts.getJSONObject(i);
id[i] = c.getString(TAG_ID);
}
I have checked that JSON file contains 25 objects. I have also tried using i<10
but it still gives same error.