I want to move what I have in my XML:
android:paddingLeft="12dp"
android:paddingRight="12dp"
to my code:
ListView listView = getListView();
listView.setPadding(12, 0, 12, 0);
The problem is that is appears the “setPadding” call only sets it by pixels, not dp. Anyone know how to properly set this in code?
you’ll have to do the conversion manually: