Avadhani Y
Avadhani Y

Reputation: 7636

How to Implement Custom List View for the list Items in Android Application

I had a problem with the list view having both parent list and the child list of the list activity(implemented through database query). I wish to show them differing their properties by changing the text style (parent list items are in bold, child list items are in normal style).

I wish to differ with Parentid(Null, NotNull)in their text style(bold, normal) for parent and child items respectively. Please help me with the code/links. Thanks a lot in advance.

Upvotes: 0

Views: 131

Answers (1)

Jens
Jens

Reputation: 6383

Maybe an ExpandableListAdapter would be a way to go? (You can make the parent elements non-expandable if you want.)

If you want to stick with the simple list, you can override getView(int position, View convertView, ViewGroup parent).

And maybe also override bindView(View view, Context context, Cursor cursor).

I have used the option of overriding bindView() to add a tag to a view and examine this later on. Maybe this would also work for you...

Upvotes: 1

Related Questions