Having problem getting ListView to show selected

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

Having problem getting ListView to show selected

Postby whtdrgn101 » Fri Dec 26, 2008 2:09 am

All,

I am trying to create a simple application using a ListView which displays an icon and then text next to it. I have gotten the ListView working by extending a Cursor adaptor but I'm having trouble getting ListView to show the selected item after the onListItemClick() event. The selected item is highlighted after I navigate to it with the keyboard, but not the touch.

Here is my onListItemClick() code:

@Override
protected void onListItemClick(ListView l, View v, int position, long id) {
super.onListItemClick(l, v, position, id);
setSelection(position);
movieId = id;
}
Attachments
Unselected.png
Navigate using the mouse
Unselected.png (8.17 KiB) Viewed 141 times
selected.png
Navigate using the keyboard
selected.png (14.77 KiB) Viewed 141 times
--
Kind Regards
Timothy A. DeWees
whtdrgn101
Freshman
Freshman
 
Posts: 2
Joined: Fri Dec 26, 2008 2:04 am

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 11 guests