getView from CustomizedAdapter called several times

by Ola Ingvaldsen » Thu, 23 Jul 2009 16:20:32 GMT


Sponsored Links
  am having the same problem. In my case it only happens if I specify my own
layout using setContentView in onCreate() of my ListActivity. If i use the
standard layout i get correct number of calls to getView.

The thing is that if I have 5 items in my list i suspect the first 5 calls
to getView to have convertView=null each time. But its not. First time its
null, then the next 5 calls have the same convertView as the previous call
and then 5 more calls where the convertView is null. So the first 6 calls
to getView only results in changing the first element 5 times more than
whats necessary. After the 5 first calls the convertView is null and the
rest of the items in the list are filled out correctly. But when i scroll
down the list, we have 10 more calls again.

Does anybody have an idea whats wrong? Or how it can be avoided?

I have no weights in my layout at all. Its just a simple textView with a
status message and a listView.

-Ola

On Wed, Jul 15, 2009 at 4:05 PM, Streets Of Boston
<flyingdutc...@gmail.com>wrote:


--~--~---------~--~----~------------~-------~--~----~



getView from CustomizedAdapter called several times

by Romain Guy » Thu, 03 Sep 2009 00:02:37 GMT


 here's nothing wrong with this, it can (and it will in some
situations) happen. getView() is not guaranteed to be called exactly
once per item. It happens for instance when you set the list/grid with
a height=wrap_content.

On Wed, Sep 2, 2009 at 5:32 AM, Guitou<drumsensati...@gmail.com> wrote:



--
Romain Guy
Android framework engineer
romain...@android.com

Note: please don't send private questions to me, as I don't have time
to provide private support. All such questions should be posted on
public forums, where I and others can see and answer them

--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Other Threads

1. string to double

Hello,

Is there an function to change an string with a comma to a double.

example code;

stripline1.Z0 = "123.45" (with point)

DecimalFormat df = new DecimalFormat("#.##");
strip_Z0.setText(df.format(stripline1.Z0));

The value in the textEdit entry will be with a comma or point, depending on
the locale setting.

If  I convert the string, with comma, directly to a double I get a "force
close".

How do I transform a string with comma to a string with point.

Faust

-- 

2. IQ Magazine -- special Android edition

http://iqmagazineonline.com/current/

rday

-- 

========================================================================
Robert P. J. Day                               Waterloo, Ontario, CANADA

            Linux Consulting, Training and Kernel Pedantry.

Web page:                                          http://crashcourse.ca
Twitter:                                       http://twitter.com/rpjday
========================================================================

-- 

3. is it possible to change the application name dynamically???

4. Ordered List

5. Rss yg bagus

6. Need applications using framebuffer

7. Janky Custom Cursor Adapter