0
我使用以下代碼來設置背景,例如TextView
,LinearLayout
,並且它完美地工作。使用遠程視圖設置卡片視圖的背景
RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.widget);
views.setInt(R.id.textview, "setBackgroundColor", Color.parseColor(widgetTextColor.toString()));
但我嘗試設置的CardView
的背景下,它沒有工作。我試過
views.setInt(R.id.cardview, "setCardBackgroundColor", Color.parseColor(widgetTextColor.toString()));
任何解決方法?