访问使用适配器动态创建的对象
我使用 SimpleAdapter
和 创建了一个带有
。TextView
和 Spinner
的动态 ListView
ViewBinder
在用户选择 Spinner
值后,如何访问它?
我认为我需要在 ViewBinder
内创建对微调器的引用,但是我不知道怎么办。我尝试了这个,但它不起作用:
public boolean setViewValue(View view, Object data,
String textRepresentation) {
mySpinner = (Spinner) view;
}
I've created a dynamic ListView
with TextView
s and Spinner
s, using a SimpleAdapter
and a ViewBinder
.
How can I access a Spinner
value after the user had selected it?
I think I need to create references to the spinners inside my ViewBinder
, but I don't know how. I tried this but it's not working:
public boolean setViewValue(View view, Object data,
String textRepresentation) {
mySpinner = (Spinner) view;
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该尝试 setOnItemClickListener(AdapterView.OnItemClickListener l)
另请参阅 < a href="https://stackoverflow.com/questions/4633315/how-to-add-listener-to-auto-complete-drop-down-list-in-android/4633327#4633327">这个 。
希望这有帮助。
You should try setOnItemClickListener(AdapterView.OnItemClickListener l)
Also look at this.
Hope this helps.