所以我的應(yīng)用程序有可以動(dòng)態(tài)添加的微調(diào)器,它們是從一個(gè)巨大的Course對(duì)象數(shù)組列表中填充的,如下所示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我想刪除從每個(gè)新生成的微調(diào)器中按下按鈕后選擇的值。按下按鈕時(shí),會(huì)將值保存到單獨(dú)的哈希映射中,并刪除所有現(xiàn)有的微調(diào)器,但我需要實(shí)現(xiàn)某種將被調(diào)用的更新方法,該方法將從courseList微調(diào)器獲取其值的位置重新填充或減去值。任何幫助表示贊賞
單擊按鈕后從微調(diào)器中刪除對(duì)象
BIG陽(yáng)
2024-01-05 15:07:28