扫码关注官方订阅号
在Android中如何获得动态动态添加的EditText的输入文本内容
闭关修行中......
最简单的方法,你EditText所在的activity 实现TextWatcher接口,给EditText设置监听edittext.addTextChangedListener(this);然后覆写afterTextChanged(Editable s)方法, ex:
TextWatcher
afterTextChanged(Editable s)
@Override public void afterTextChanged(Editable s) { String edt=edittext.getText().toString(); //edt就是你想要的内容 }
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
扫描下载App
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
最简单的方法,你EditText所在的activity 实现
TextWatcher
接口,给EditText设置监听edittext.addTextChangedListener(this);然后覆写afterTextChanged(Editable s)
方法,ex: