Set the color for item in Expanded List
Hi I am dispalying some items in expanded List view. those are items and their categories.If we select one item then that item status is updated to db.next when we open that list depending upon the status set that item background .For ex if the status is 0 That that item having the black background.if the status is 1 that item background is white.I am updating that item status to db and getting that values exactly.But i don't know how we set the b开发者_运维百科ackground for the items in the expanded list when it is displaying.Please give me some suggestions.it is urgent.Thanks in advance
public class MyExpandableListAdapter extends BaseExpandableListAdapter
{
public View getChildView(int groupPosition, int childPosition, boolean isLastChild, View convertView, ViewGroup parent) {
TextViewtextView = getGenericView(false);
textView.setText(getChild(groupPosition, childPosition).toString());
convertView.setBackgroundColor(【there is color :-)】);
return textView;
}
} ·········
u can create a adapter :-)
and in your acticity :
MyExpandableListAdapter mAdapter = new MyExpandableListAdapter(this); 【your_ExpandableListViewName】.setAdapter(mAdapter);
well try to change the code ---
getChildView() will change the Childview ,sorry,
you can try to change: getGroupView()
good luck friend
精彩评论