Remove ListView separator(in the xml layout file) [duplicate]

Solution 1:

Set the dividerHeight to zero and divider to null like this in xml:

android:dividerHeight="0dp"
android:divider="@null"

Or in java:

getListView().setDividerHeight(0);
getListView().setDivider(null);

Solution 2:

Simply put:

android:divider="@null"