I have an android test project with two classes:
AdapterTestActivityextendsListActivity-> http://pastebin.com/BreRSPj1MyAdapterextendsArrayAdapter-> http://pastebin.com/YUK4CRQq
From 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!
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.