ListView getting rendered multiple times


Last Updated:

  1. markdsievers

    markdsievers Member This Topic's Starter

    Joined:
    Mar 16, 2009
    Messages:
    10
    Likes Received:
    0
    So the situation is this, I have a ListView that is embedded in two LinearLayout ViewGroups to form a screen. BaseAdapter.getView() (the implementation of the ListAdapter) is typically called n times (where n is numElements) to render the screen. The problem I have is this set of calls is being repeated for every ViewGroup that the list is contained in...So for a Layout like this:

    -LinearLayout
    --Linearlayout
    ---ListView

    The adapters getView() is being called n*3 times (3 = 1 for the parent LinerarLayout, one for the child LinearLayout and one for the List itself).

    This is obvisouly a problem when the items in the List are expensive to build (even with recycling).

    So Im looking for some guidance on this, as the documentation doesnt seem to note this behaviour from what I can see.

    A small, basic example of the source is located on my post here
    ListView getting rendered multiple times :: anddev.org - Android Development Community | Android Tutorials
    with more details aswel as a ready made eclipse project(also attached below) if anyone is keen to try it out.
     

    Attached Files:


    Advertisement
  2. markdsievers

    markdsievers Member This Topic's Starter

    Joined:
    Mar 16, 2009
    Messages:
    10
    Likes Received:
    0
    Hey,

    Unfortunately I had to rush through it, so I never got a chance to come back to this...It is still to my knowledge an unsolved problem.

    Though this was on 1.5 as I recall, I haven't tried again on later versions of the sdk.

    M
     

Share This Page

Loading...