Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
スピナーの最初のアイテム、またはデフォルトのアイテムをクリックすると、スピナーが折りたたまれます。他のすべてのアイテムは、目的のアクションを実行します。アクションを発生させる最初のアイテムを取得するにはどうすればよいですか?
選択を変更したとき、つまり、で新しいアイテムを選択したときにのみが呼び出されるsetOnItemSelectedListener()ため、この問題が発生しています(のを実装していると仮定しますSpinner)。したがって、デフォルトの選択を選択すると、単に折りたたまれます。SpinneronItemSelected()SpinnerSpinner
setOnItemSelectedListener()
Spinner
onItemSelected()
この説明がお役に立てば幸いです。