Не выводит значения из БД на сервере
protected String doInBackground(Void... voids) {
try {
URL url = new URL(json_url);
HttpURLConnection httpURLConnection = (HttpURLConnection) url.openConnection();
InputStream inputStream = httpURLConnection.getInputStream();
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream));
StringBuilder stringBuilder = new StringBuilder();
while ((JSON_STRING = bufferedReader.readLine())!=null)
{
if(JSON_STRING != null){
try{
final JSONArray jArray = new JSONArray(JSON_STRING);
for(int i=0;i<jArray.length();i++)
{
JSONObject json_data = jArray.getJSONObject(i);
KEY_NAME_EVENT = json_data.getString("KEY_NAME_EVENT");
KEY_INFO_EVENT =json_data.getString("KEY_INFO_EVENT");
KEY_CONTACT =json_data.getString("KEY_CONTACT");
KEY_ADRESS = json_data.getString("KEY_ADRESS");
}
}catch(JSONException e1){
e1.printStackTrace();
}
}
stringBuilder.append(KEY_ADRESS);
}
bufferedReader.close();
inputStream.close();
httpURLConnection.disconnect();
return stringBuilder.toString().trim();
}catch (MalformedURLException e){
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
type org.json.JSONArray cannot be converted to JSONObject