Reputation: 399
I have an android test project with two classes:
AdapterTestActivity
extends ListActivity
-> http://pastebin.com/BreRSPj1 MyAdapter
extends ArrayAdapter
-> http://pastebin.com/YUK4CRQqFrom System.out.println()
in MyAdapter
I get this printout:
05-22 16:43:03.942: I/System.out(17943): test 1
05-22 16:43:03.942: I/System.out(17943): test 2
05-22 16:43:03.950: I/System.out(17943): test 3
05-22 16:43:04.098: I/System.out(17943): test 1
05-22 16:43:04.098: I/System.out(17943): test 2
05-22 16:43:04.098: I/System.out(17943): test 3
05-22 16:43:04.106: I/System.out(17943): test 1
05-22 16:43:04.106: I/System.out(17943): test 2
05-22 16:43:04.106: I/System.out(17943): test 3
but I expected something like:
test 1
test 2
test 3
Does anyone know why? - thanks!
Upvotes: 0
Views: 87
Reputation: 3323
and for your 2nd question, you may need to add :
_adapter.notifyDataSetChanged();
after adding your "test 4"
Upvotes: 0
Reputation: 157457
It is not a strange behavior, but it is an implementation detail of the framework. There is no guarantee on which or order or how many time getView()
is called.
Upvotes: 1