Hi,
I've created an inbox Activity and I'm mirroring some functionality of the default Mail application that comes with Android.
In Mail, the background color of a message that has not been read is a lighter color than the rest of the items in the list. I've mirrored this by setting calling setBackgroundResource in the getView method of my Adapter. setBackgroundColor doesn't do anything.
if (!msgSum.getIsRead()) {
LinearLayout l = (LinearLayout) v.findViewById(R.id.inbox_background);
if (l != null) {
l.setBackgroundResource(R.color.inbox_unread);
}
}
else {
LinearLayout l = (LinearLayout) v.findViewById(R.id.inbox_background);
if (l != null) {
l.setBackgroundResource(R.color.inbox_read);
}
}
The problem is, the items then lose the ability to highlight. What I mean is, typically if you scroll your mouse wheel while using the emulator (or if your Android device has some sort of scrolling capability, you use that), the list items will turn yellow like they have focus.
How do I accomplish what I'm trying to do without losing the ability to highlight a list item?
Thanks for your help