所以我的应用程序有可以动态添加的微调器,它们是从一个巨大的Course对象数组列表中填充的,如下所示
courseSpinner = rowView.findViewById(R.id.first_spinner);
ArrayAdapter<Course> adapter = new ArrayAdapter<>(this, android.R.layout.simple_spinner_item, courseList);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
courseSpinner.setAdapter(adapter);
parentLayout.addView(rowView, parentLayout.getChildCount() - 1);
allSpinners.add(courseSpinner); //this is an ArrayList of spinners that keeps track of how many spinners exist currently since like mentioned before they can be dynamically added or removed
我想删除从每个新生成的微调器中按下按钮后选择的值。按下按钮时,会将值保存到单独的哈希映射中,并删除所有现有的微调器,但我需要实现某种将被调用的更新方法,该方法将从courseList微调器获取其值的位置重新填充或减去值。任何帮助表示赞赏
萧十郎
相关分类