getView什么时候调用完成?
我将列表视图项目位置保存在适配器方法“getView”中的集合中, 保存了当前显示项的位置,
但是调用setAdapter(myAdapter)后无法获取到设置的内容, 貌似是多线程的 如果可以的话,什么时候可以拿到设定的内容。
I save the listview items position in a set in adapter method "getView",
which saves the current displaying items position,
but I can't get the set content after invoking setAdapter(myAdapter),
It seems that it's multi-thread,
if that, when can i get the set content.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
那就不是“多线程”了。但是,当您调用
setAdapter()
时,Adapter
不会立即使用,任何超过TextView
的内容都会在您调用 <代码>setText()。所有 GUI 事件均由基于工作队列的主应用程序线程处理 - 对 setAdapter() 的调用只有在您所在的任何代码块返回后才会生效。It is not "multi-thread". However, the
Adapter
will not be immediately used when you callsetAdapter()
, any more than aTextView
will be immediately updated when you callsetText()
. All GUI events are processed by the main application thread based off of a work queue -- calls tosetAdapter()
will not take effect until after whatever block of code you are in returns.