Skip to content Skip to sidebar Skip to footer

Android Custom Adapters

I'm using Android's custom adapters to create a list view for my application. I'm looking to show whether or not someone's in first, second or third place and also show unique ba

Solution 1:

I also didn't look through your code, and would probably like to see the code for your custom adapter.

I would suggest in your custom adapter, that you determine the value of the award for that particular line item, and set the badge image specifically at that time.

so in your adapter (pseude-code):

if (user.getAward() == myRedValue) {
    awardImageView.setBackgroundResource(R.drawable.red_award);
} elseif (user.getAward() == myBlueValue) {
    awardImageView.setBackgroundResource(R.drawable.blue_award);
} etc...

Post a Comment for "Android Custom Adapters"