How do I set a drawable as the background for a list view in a class?
if (array1.size() < 8) { lv1.setBackgroundDrawable(R.drawable.bgimghs2b); }
You should use:
Drawable background = this.getResources().getDrawable(R.drawable.yourBackgroundDrawableID); lv.setBackgroundDrawable(background);