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.
特別に作られたスピナーではないことをしようとしています。動的に変化するリストを取得しました。ユーザーがアイテムを選択したときに onSelectedItemClick をキャッチする必要があります。スピナー アダプターにアイテムが 1 つしかない場合に問題が発生します。それを選択しても (または、既に選択されているので再選択しても)、OnSelectedItemListener は起動しません。
そうでなければ、どうすればそれを捕まえることができますか?
アイテムが1つしかない場合は、スピナーから選択する必要はなく、入ることができますonSeletedItem method.
onSeletedItem method.
String str = (String)parent.getSeletedItem();