Richard,

You are missing getCount in your adapter, and the base class's version (ArrayAdapter) returns 0 because you didn't pass your data array to super() in the constructor. So the list view thinks there are zero items in the adapter, and does not create any views.

The way you have things set up, there are two places that have responsibility for the adapter's data array: the base class, ArrayAdapter, has a data array reference, and your subclass does too (in its member variable, "al").

Two ways to fix it:

- Get rid of "al" in your subclass, pass the data array to ArrayAdapter, get data items from it as needed (using getItem());

- Continue using "al" in your subclass, but then don't use ArrayAdapter, extend BaseAdapter instead.

-- Kostya

01.03.2011 11:51, Richard Sámela пишет:

On 1. Mar., 01:59 h., TreKing<treking...@gmail.com>  wrote:
On Mon, Feb 28, 2011 at 5:53 PM, Richard Sámela<feromak...@gmail.com>wrote:

Have you confirmed that:
1 - your array list actually has items and
2 - your getView function is being called

I sure that my ListArray contains items of type MyRecord I tried to
write them to Log.d
but I add control Log.d method to getView and nothing happens. So
getView method isn't being called.
But it should be overided method and should be funkction automaticly,
shouldn't be? or why getView doesn't work? is there some mistake in
code? because I make this method by tutorial...



--
Kostya Vasilyev -- http://kmansoft.wordpress.com

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to