我有以下设置。在我的XML中,我有一堆图像视图。我试图根据偏好设置和星期几来显示其中的一个。这一定很容易,但我找不到将变量传递给findViewByID的正确方法。这里是代码片段:将变量传递给findViewByID
String groupName = "R.id."+prefs.getString("groupListKey", "<unset>")+"_"+(Calendar.getInstance().get(Calendar.DAY_OF_WEEK));
ImageView image = (ImageView) findViewById(groupName);