I want to read JSON web service result.
My web service result is
[{"etkinlikTarihi":123,"eposta":"posta","etkinlikAdi":"ali","etkinlikDetay":"veli","etkinlikId":1},{"etkinlikTarihi":12,"eposta":"posta","etkinlikAdi":"ali","etkinlikDetay":"detay","etkinlikId":2},{"etkinlikTarihi":13,"eposta":"posta","etkinlikAdi":"mali","etkinlikDetay":"detay","etkinlikId":3},{"etkinlikTarihi":13,"eposta":"posta","etkinlikAdi":"mali","etkinlikDetay":"detay","etkinlikId":4}]
But, whenever I try to read with JSONObject
in Android, I get a exception...
My code is here,
jsonResponse = new JSONObject(wsEtkinlikListesi);
String etkinlikTarihi = jsonResponse.getString("etkinlikTarihi");
And this is my stack trace:
org.json.JSONException: Value [{"etkinlikAdi":"toplanti","etkinlikDetay":"toplan","etkinlikTarihi":1454648400000,"etkinlikId":5,"eposta":"sefagenel@gmail.com"}] of type org.json.JSONArray cannot be converted to JSONObject
Where is my mistake and how can I correct it?