[英]How to change the background color of cardview and save that changes?
我尝试使用cardView setCardBackgroundColor(Color.BLUE)
打开后更改cardview的背景颜色。 但我不知道如何保存这些变化。 请帮我。
使用共享首选项存储颜色并设置存储在共享首选项中的颜色
SharedPreferences.Editor editor = getSharedPreferences(MY_PREFS_NAME, MODE_PRIVATE).edit();
editor.putInt("color", "yourColor");
editor.apply();
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.