Tony Lukasavage

Caffeine. Whiskey. Code. Mostly the last one.

Android Quick Tip: Remove ListView Dividers

Quick Tip

If you want to remove the dividers from an Android ListView, execute the following code on your ListView object.

1
2
3
ListView listView = (ListView)findViewById(R.id.your_listview_id);
listView.setDivider(null);
listView.setDividerHeight(0);

or if you are trying to remove dividers from a ListActivity, do this in your onCreate() method:

1
2
this.getListView.setDivider(null);
this.getListView.setDividerHeight(0);

And there you go, no more dividers. Enjoy.