我正在嘗試將數(shù)據(jù)從我的arrayList列表視圖中填充。但由于某種原因我收到錯誤error: no suitable constructor found for ArrayAdapter(activity2.SendPostRequest,int,int,ArrayList<HashMap<String,String>>)constructor ArrayAdapter.ArrayAdapter(Context,int,int,HashMap<String,String>[]) is not applicable JSONArray json = new JSONArray(data); ArrayList<HashMap<String, String>> arrayList = new ArrayList<HashMap<String, String>>(); HashMap<String, String> map = new HashMap<String, String>(); try { for(int i=0;i<json.length();i++){ JSONObject e =json.getJSONObject(i); map.put("id", String.valueOf(i)); map.put("Name", "Vorname: " + e.getString("meta_value")); map.put("orderid", "id: " + e.getString("post_id")); arrayList.add(map); return map.toString(); } ArrayAdapter<HashMap<String, String>> adapter = new ArrayAdapter<HashMap<String, String>>(this,android.R.layout.simple_list_item_1, android.R.id.text1, arrayList); list.setAdapter(adapter); }catch (JSONException e){ Log.e(this.getClass().getName(), "Some JSON error occurred" + e.getMessage()); }到處都找不到解決辦法
將數(shù)據(jù)填充到 Listview 但 Arrayadapter 不起作用
HUH函數(shù)
2023-10-19 21:17:54