ListView listView = findViewById(R.id.listView); listView.setDividerHeight(10);
ListView listView = new ListView(this); listView.setDividerHeight(0);In this example, a ListView with no dividers is created dynamically and a divider height of 0 pixels is set. Package library: android.widget.