Programmatically set the listSelector for a ListView to the default for the current theme
private static void setDefaultListSelector(ListView listView, Context context) { TypedArray typedArray = context .obtainStyledAttributes(null, new int[]{android.R.attr.listSelector}, android.R.attr.listViewStyle, 0); Drawable drawable = typedArray.getDrawable(0); listView.setSelector(drawable); }