我有一个哈希图,我正在加载到一个简单的适配器中
public static ArrayList<HashMap<String, String>> songsList = new ArrayList<HashMap<String, String>>();
....
musiclist = (TextView) getView().findViewById(R.id.checkTextView);
filelv = (ListView)getView().findViewById(R.id.FileList);
filelv.setItemsCanFocus(false);
filelv.setChoiceMode(AbsListView.CHOICE_MODE_MULTIPLE);
//if (trackcount>previousTrackCount){
ListAdapter playlistadapter = new SimpleAdapter(getActivity().getApplicationContext(), songsList, R.layout.file_view,
new String[] { "songTitle","songAlbum", "songPath" }, new int[] { R.id.checkTextView, R.id.text2, R.id.text3 });
filelv.setAdapter(playlistadapter);
这完美地工作,给我在我的列表视图中显示的所有三个值。
但是...我希望能够连接字符串,以便每个列表项的第二行如下
songAlbum(songArtist)
例如,有注意左输(Foo Fighters)
当我将 ListAdapter 更改为以下内容时,第二行只是空白
ListAdapter playlistadapter = new SimpleAdapter(getActivity().getApplicationContext(), songsList, R.layout.file_view,
new String[] { "songTitle","songAlbum" + "(" + "songArtist" + ")", "songPath" }, new int[] { R.id.checkTextView, R.id.text2, R.id.text3 });
我已经测试了所有字符串以确保它们包含数据。
请提出建议!