如何在 Android 中将 JSONArray 转换为 ListView?

How to convert JSONArray to ListView in Android?

我的 json 是:{"成功":["demo20","demo21","iostest3"],"errorCode":0}

我需要解析器 json 然后在 ListView 中添加值,这是我的代码 :

 ArrayList<String> items = new ArrayList<String>();
 JSONObject object = new JSONObject(result.toString());
 int errorCode = object.getInt("errorCode");
 if (errorCode == 0){
     JSONArray array = object.getJSONArray("success"); 
      for (int i = 0; i < array.length(); i++){
          ????
       }
     ArrayAdapter<String> arrayAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, items);
     listView.setAdapter(arrayAdapter);
 }

 please help me , thanks.
for (int i = 0; i < array.length(); i++){
      items.add(array.getString(i));
}