如果微调器是触摸式的,我试图删除微调器项目。但如果微调不碰我不想将其删除。而且我什至不能用.remove
删除该项目,因为它将删除两个同名项目,而我不能使用.removeAt
,因为当我使用它时,它将删除第一项中的2个索引。
在下面我的代码,我使用卸下摆臂。请帮助如何使其工作
movies.addAll(data)
items.add(title)
list_id.add(idMovie)
movies.map {
items.add(it.title)
list_id.add(it.movieId)
}
Log.v("id", "" + id)
Log.v("title", "" + items)
Log.d("list1", list_id.toString())
searchSpn.adapter = ArrayAdapter<String>(this, R.layout.spinner_item, items)
searchSpn.onItemSelectedListener = object : AdapterView.OnItemSelectedListener {
override fun onNothingSelected(p0: AdapterView<*>?) {
id = idReview
}
override fun onItemSelected(p0: AdapterView<*>?, p1: View?, p2: Int, p3: Long) {
list_id.remove(idMovie)
items.remove(title)
movie = p0?.selectedItemPosition!!
Log.d("TAG", movie.toString())
Log.d("list", list_id.toString())
id = list_id[movie]
Log.d("TAG", movie.toString())
}
}