Minilin
Minilin

Reputation: 71

When does the getView finished invoked?

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.

Upvotes: 0

Views: 664

Answers (1)

CommonsWare
CommonsWare

Reputation: 1006644

but I can't get the set content after invoking setAdapter(myAdapter), It seems that it's multi-thread, if that,

It is not "multi-thread". However, the Adapter will not be immediately used when you call setAdapter(), any more than a TextView will be immediately updated when you call setText(). All GUI events are processed by the main application thread based off of a work queue -- calls to setAdapter() will not take effect until after whatever block of code you are in returns.

Upvotes: 1

Related Questions