What you are looking for is:
CardView card = ...
card.setCardBackgroundColor(color);
In XML
card_view:cardBackgroundColor="@android:color/white"
Update:
in XML
app:cardBackgroundColor="@android:color/white"
More Related Contents:
- CardView layout_width=”match_parent” does not match parent RecyclerView width
- Error inflating class and android.support.v7.widget.CardView
- Android-L CardView Visual Touch Feedback
- CardView not showing Shadow in Android L
- Ripple effect on Android Lollipop CardView
- Using android.support.v7.widget.CardView in my project (Eclipse)
- OnClickListener for CardView?
- Cardview shadow not appearing in lollipop devices?
- This Activity already has an action bar supplied by the window decor
- How to use the new SD card access API presented for Android 5.0 (Lollipop)?
- How can incoming calls be answered programmatically in Android 5.0 (Lollipop)?
- Material effect on button with background color
- Action bar navigation modes are deprecated in Android L
- How can I change default dialog button text color in android 5
- Datepicker dialog without calendar visualization in lollipop [spinner mode]?
- GLES10.glGetIntegerv returns 0 in Lollipop only
- getRunningTasks doesn’t work in Android L
- INSTALL_FAILED_DUPLICATE_PERMISSION… C2D_MESSAGE
- How to style the DrawerArrowToggle from Android appcompat v7 21 library
- Enabling Location mode High Accuracy or Battery saving, programmatically, without user needing to visit Settings
- completely transparent status bar and navigation bar on lollipop
- Android SD Card Write Permission using SAF (Storage Access Framework)
- notifyDataSetChanged not working on RecyclerView
- Custom Translucent Android ActionBar
- Android 5.0: how to change recent apps title color?
- Understanding RecyclerView setHasFixedSize
- No adapter attached; skipping layout [duplicate]
- How to change system navigation bar color
- Change status bar color with AppCompat ActionBarActivity
- How to get the real path with ACTION_OPEN_DOCUMENT_TREE Intent?