the CardView ( android.support.v7.cardview ) stays white even though I set a backround drawable via android:backround - The documentation gives me the feeling that it should
The command I used was:
cardView.setBackgroundResource(R.drawable.card_view_bg);
where card_view_bg is a custom XML resource file.
If you have some layouts inside the card view and these layouts are overlapping with the margins of the card view then you might need a separate custom background resource file for the layouts like the one I used for the card view background itself.