博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
获得spinnar中选中的值
阅读量:4172 次
发布时间:2019-05-26

本文共 642 字,大约阅读时间需要 2 分钟。

public class YourItemSelectedListener implements OnItemSelectedListener {
public void onItemSelected(AdapterView<?> parent, View view, int pos, long id) {
String selected = parent.getItemAtPosition(pos).toString();
}
public void onNothingSelected(AdapterView parent) {
// Do nothing.
}
}
public class YourItemSelectedListener implements OnItemSelectedListener {
public void onItemSelected(AdapterView<?> parent, View view, int pos, long id) {
String selected = parent.getItemAtPosition(pos).toString();
}
public void onNothingSelected(AdapterView parent) {
// Do nothing.
}
}
spinner.setOnItemSelectedListener(new MyOnItemSelectedListener());

转载地址:http://krbai.baihongyu.com/

你可能感兴趣的文章
Spring boot读取配置的方式(指定配置文件)
查看>>
Spring Boot切换不同环境配置
查看>>
Spring cloud之Ribbon搭建
查看>>
TreeMap 与 HashMap 的区别
查看>>
初识CAS
查看>>
Fork/Join 框架
查看>>
服务雪崩效应
查看>>
策略模式实例
查看>>
PostgreSQL数据库管理 第八章日常运维
查看>>
PostgreSQL数据库管理第十章Repmgr
查看>>
Linux shell正则表达式-sed-awk-grep应用
查看>>
linux系统管理—第五章Linux-bashshell
查看>>
PostgreSQL数据库管理 第二章体系结构
查看>>
PostgreSQL数据库管理 第三章实例管理与管理工具
查看>>
PostgreSQL数据库管理第七章流复制
查看>>
PostgreSQL数据库管理第十章Repmgr
查看>>
PostgreSQL数据库管理 第八章日常运维
查看>>
MySQL数据库管理-体系结构
查看>>
软考UML
查看>>
信息系统的生命周期各阶段及说明
查看>>