how can I put multiple objects from List into one textview in ListAdapter? Here is my code:
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_music_browser);
musichelper msc = new musichelper(this);
List<HashMap<String, String>> musics = msc.buildMusic();
ListView lv = (ListView)findViewById(R.id.listView);
ListAdapter la = new SimpleAdapter(this, musics, R.layout.song_list,
new String[] { "artist"+" - "+"title", "duration" }, new int[] { R.id.pickerName, R.id.pickerLength }
);
lv.setAdapter(la);
This ends up having no artist and no title but I want it to be like: Artist - Song Name assigned to TextView called R.id.pickerName.
Also duration is in milliseconds, how can I convert it directly when building ListAdapter? I want milliseconds for example: 414616 to be written as: 7:31 (I think)
This is what I end up with when trying to combine Artist + - + Title. And as you see - duration appears in milliseconds.
I know I could do all of the above when building the List of objects but I would like to keep them as seperate objects.