Android:如果已选中,则点击的微调器项目不起作用

Hul*_*ulk 7 android android-spinner

我有一个带有onItemSelected交互的Spinner,但是Api规范如何说:

This callback is invoked only when the newly selected position is different from the 
previously selected position or if there was no selected item.
Run Code Online (Sandbox Code Playgroud)

我需要删除此限制,我希望如果用户选择相同的元素也调用回调.怎么做?
有人做过同样的事吗?

对此有任何想法都会很明显..

Aru*_*rge 1

i want that the callback is invoked also if the user select the same element. How to do that?

设置OnItemClickListenerSpinner 会引发异常,并且ItemSelectedListener如果用户单击所选/相同元素,您将不会收到通知。

我想克服这个限制的唯一方法是对 Spinner 项目使用 CustomAdapter 并 setOnClickListener为适配器中的每个视图实现 。