Setting a spinner onClickListener() in Android
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to get an onClickListener to fire on a Spinner, but I get the following error: Java.lang.RuntimeException is "Don't call setOnClickListener for an AdapterView. You probably want setOnItemClickListener instead," I'm sure I want to call onClickListener and NOT onItemClickListener. I found a question asked by someone else on Stack Overflow, Is there a way to use setOnClickListener with an Android Spinner? The answer stated there is: You will have to set the Click listener on the underlying view (normally a TextView with id: android.R