我有2个适配器,其中每个适配器都包含不同的API,我想将其放入一个列表视图。我如何设置第二个适配器而不更换第一个适配器?前:)Android将多个适配器设置为一个列表视图
pcAPI = (ArrayList<ListAPI>) parsepcAPI(pcTemp);
artistAPI = (ArrayList<ListAPI>) parseArtistAPI(artistTemp);
lvAPI = (ListView) findViewById(R.id.lvAPI);
Song_APIAdapter adapter = new Song_APIAdapter(getApplicationContext(), pcAPI);
lvAPI.setAdapter(adapter);
Song_APIAdapter adapter2 = new Song_APIAdapter(getApplicationContext(), artistAPI);
lvAPI.setAdapter(adapter2);
你能描述哪些适配器的内容可能有解决方案吗? – Raghunandan
https://github.com/commonsguy/cwac-merge – Renjith
在pcAPI和artistAPI中添加项目并调用'adapter.notifyDataSetChanged();' –