Hmm, hold that... Might have made a mistake in my tests... I'll revisit this tomorrow when my brain works better :)
Cheers, Olof On Feb 15, 7:45 pm, Olof Hedman <[email protected]> wrote: > Thanks for the log! > Which version of android did you run it on? > > It made my try one more thing... > I simplified my layout as much as I could, and this actually got rid > of the extreme weirdness, and made my log look like yours. > > I don't get though why it would matter. > The problem seem to be the relative-layout I have in the background. > (I use it for a background image + a logo shown behind the list) > > Here is my layout with just the relative-layout commented > out:http://pastebin.com/zFBxL97m > > The view never resizes or anything, so there seems to be some funky- > ness going on when it inflates the views for the Activity. > Do you have any idea of why it would behave like this because of the > relativelayout? > > Also still weird it thinks its necessary to re-getting the views when > the screen power down, but at least the user will only notice that > because of slightly worse battery life :) > > Cheers, > Olof > > On Feb 15, 5:28 pm, Kostya Vasilyev <[email protected]> wrote: > > > > > > > > > On 02/15/2012 08:02 PM, Olof Hedman wrote: > > > >> Perhaps it's populating a cache of some kind? > > > > That theory doesn't hold. > > > It would only need to cache the views once, and if you look at what is > > > actually happening, you will se it binds the_same_view_ over and over > > > with different list item data. > > > Nothing is then cached, for a list with 8 items, the information will > > > be overwritten 16 times before it settles and start to create more > > > views for the list. > > > I just happened to have an app with ListView handy, so, here is my log, > > the number is the position passed into getView, the reference is the > > convertView: > > > When the activity is shown for the first time: > > > 02-15 20:17:45.058 I/ScanViewModeList(11347): getView for 0, null > > 02-15 20:17:45.097 I/ScanViewModeList(11347): getView for 1, null > > 02-15 20:17:45.160 I/ScanViewModeList(11347): getView for 2, null > > 02-15 20:17:45.238 I/ScanViewModeList(11347): getView for 0, > > android.widget.LinearLayout@41877ac8 > > 02-15 20:17:45.238 I/ScanViewModeList(11347): getView for 1, > > android.widget.LinearLayout@418c4fe8 > > 02-15 20:17:45.238 I/ScanViewModeList(11347): getView for 2, > > android.widget.LinearLayout@41879f70 > > > After the list is invalidated: > > > 02-15 20:17:47.832 I/ScanViewModeList(11347): getView for 0, > > android.widget.LinearLayout@41877ac8 > > 02-15 20:17:47.840 I/ScanViewModeList(11347): getView for 1, > > android.widget.LinearLayout@418c4fe8 > > 02-15 20:17:47.847 I/ScanViewModeList(11347): getView for 2, > > android.widget.LinearLayout@41879f70 > > > The initial calls to getView with null are, perhaps, unnecessary, but > > could be legit. In any case, they only happen once, when the listview is > > initally shown. > > > As for your log - does your code do anything that could cause listview > > to change its size, and force a new layout pass? does it unnecessarily > > call adapter.notifyDataSet{Changed|Invalidated}? > > > -- Kostya -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

