Listview choice mode not changed

Put your problem here if it does not fit any of the other categories.

Listview choice mode not changed

Postby thunder » Sat Jun 26, 2010 8:10 am

here in the following code when i try to change the choice mode of the listview it cant change please help me to change its choice mode its very urgent

public void ListAllSongs()
{


Uri allsongsuri = MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;
String selection = MediaStore.Audio.Media.IS_MUSIC + " != 0";

cursor = managedQuery(allsongsuri, STAR, selection, null, null);

if(cursor != null)
{
if(cursor.moveToFirst())
{
do
{
String songname = cursor.getString(cursor.getColumnIndex(MediaStore.Audio.Media.DISPLAY_NAME));
songlist.add(songname);

}while(cursor.moveToNext());
cursor.close();
}
}

songadapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1,songlist);
lvdisplay.setAdapter(songadapter);
lvdisplay.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);

}
thunder
Freshman
Freshman
 
Posts: 8
Joined: Sat Jun 05, 2010 11:14 am

Top

Re: Listview choice mode not changed

Postby rciovati » Sat Jun 26, 2010 9:12 am

Try setting another view for the row, like android.R.layout.simple_list_item_multiple_choice
rciovati
Developer
Developer
 
Posts: 25
Joined: Mon Jan 04, 2010 12:52 am
Location: Milano (Italy)

Re: Listview choice mode not changed

Postby thunder » Sat Jun 26, 2010 10:38 am

Thanks for your reply...

its working now..

i made silly mistake ..

Thanks once again
thunder
Freshman
Freshman
 
Posts: 8
Joined: Sat Jun 05, 2010 11:14 am

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 24 guests