Reputation: 9
I have updated my List view values from an array list but now I want to add two buttons in each row of list view just for playing and stopping sound. How can I add buttons in List View manually ,I mean by code or any other source. Here is what I have done
Calendar cal = Calendar.getInstance();
cal.setTime(now);
prayerTimes = prayers.getPrayerTimes(cal, latitude,
longitude, timezone);
ArrayList prayerNames = prayers.getTimeNames();
ArrayList<String>list= new ArrayList<String>();
for (int i = 0; i < prayerTimes.size(); i++)
{
if(i==0||i==2||i==3||i==5||i==6)
{
list.add((String)prayerNames.get(i)+"-"+(String)prayerTimes.get(i));
}
}
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, list);
azanList.setAdapter(adapter);
Upvotes: 0
Views: 73
Reputation: 2866
Have a look at :
http://www.androidhive.info/2012/02/android-custom-listview-with-image-and-text/
http://hmkcode.com/android-custom-listview-items-row/
Custom listview is all you need
Upvotes: 1