晚上好,我是Android开发的新手,我在从JSON URL填充ListView
时遇到问题
虽然解析很好。这是我到目前为止所尝试的:
try {
JSONArray array = new JSONArray(result);
String asef = "";
for(int i = 0; i < array.length(); i++)
{
JSONObject hospital = array.getJSONObject(i);
JSONObject hospital2 = hospital.getJSONObject("address");
if (!hospital2.isNull("hospital")) {
String hospitalName = hospital2.getString("hospital");
String hospitalLat = hospital.getString("lat");
String hospitalLon = hospital.getString("lon");
hospitals.add("hospitalLat");
}
}
}
这是我的列表视图
ListView listView = (ListView) findViewById(R.id.listView);
ArrayList<String> hospitals = new ArrayList<String>();