android – ListView divider not showing-ThrowExceptions

Exception or error:

I have a ListView with BaseAdapter. In XML, I specified item divider as red color with 10dip height.

    <ListView android:layout_width="fill_parent"

But, when the app runs, I didn’t see the red dividers between items. Can someone tell me why? Thanks.

Edit: in my adapter code, I have the following code:

public boolean areAllItemsEnabled() {
    return false;

public boolean isEnabled(int position) {
    return false;

because I want control the onClick behavior of each item. I don’t know whether the code above makes the dividers disappear.

How to solve:

The layout is good and it should work. I just tested it myself and it did work for me.
Try seeing what you have in your list item layout or your list activity class.

If that doesn’t work I would recommend creating a normal list from the samples and give the list these attributes and see what happened.


Leave a Reply

Your email address will not be published. Required fields are marked *