I'm not a google engineer, so i don't know the answer, but i have a
theory why this may happen.

In your layouts, do you use 'weights' (weightsum and layoutweight)?
If i remember correctly, if you use these attributes, layout-code is
called twice.
If the layout-code for a list-view includes the 'getView' then this
would explain it being called 4 times for 2 child views.

On Jul 15, 2:40 am, Mika <[email protected]> wrote:
> Hi,
>
> I'm having the same problem. Did you find any solutions??
>
> -Mika
>
> On Jun 24, 7:39 pm, jabu <[email protected]> wrote:
>
>
>
> > Hi Everyone,
>
> > I am implementing my ownadapterthat inherits from BaseAdapter (this
> > is something very classic).
> > Then when I start the activity that owns the listView binded to 
> > thisadapterI can see that the getView() method is called moretimesthan
> > what the number of view actually available in the list.
> > For instance, I do have 2 rows in my list and when I first set 
> > theadaptergetView is called 6times. Then If I make a call to
> > notifyDataSetChanged(), getView is called 4times.
> > I understand that when you scroll up and down getView must be called
> > to generate or re use a view but I don't scroll up or down, I am
> > really wondering why getView is called so many time.
>
> > Thanks a lot in advance for your responses.
> > Jabu
>
> > My code just in case even though it is a pretty basic piece of code:
>
> >         public View getView(int position, View convertView, ViewGroup
> > parent)
> >         {
> >                 ViewHolder holder;
> >                 if (convertView == null)
> >                 {
> >                         convertView = 
> > mInflater.inflate(R.layout.row_action, null);
> >                         // Creates a view holder
> >                         holder = new ViewHolder();
> >                         ...
> >                         convertView.setTag(holder);
> >                 }
> >                 else
> >                 {
> >                         holder = (ViewHolder)convertView.getTag();
> >                 }
> >                         holder.params.set....
> >                         return convertView;
> >          }- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to