[Wish] listview.item(xx).settext

jmon

Well-Known Member
Licensed User
Longtime User
Hi,

I think the listview is missing a listview.setitem property. It would be very useful to have this. The idea would be to change the text, image or second label text of a given item in the list.

It could be something like that:
listview.item(34).settext

I know that it can be done using the CustomListview but it seems that the custom listview is limited by the number of items (1000-2000).

Regards
jmon
 

jmon

Well-Known Member
Licensed User
Longtime User
I'm surprised noone replied to this thread. It seems like something that everyone would need when working with a listview. At the moment because this feature is missing, when I need to update a single element il a list of 25000 items, I have to clear and refill the listview!
 

stevel05

Expert
Licensed User
Longtime User
There is no settext method in the underlying Android class see here Android Developers Documentation. I guess it's a trade off for the speed of retrieval and memory management to allow large lists to be contained in one object.
 

jmon

Well-Known Member
Licensed User
Longtime User
There is no settext method in the underlying Android class see here Android Developers Documentation. I guess it's a trade off for the speed of retrieval and memory management to allow large lists to be contained in one object.

I see.... That's a pity then. It seems like a very basic feature missing. I guess I'll have to find another method. I was thinking that the gmail app was using a listview to display the emails but the must be using a scrollview then.

Thanks

Sent from my GT-P7500 using Tapatalk HD
 

stevel05

Expert
Licensed User
Longtime User
I don't know what GMail uses, there are various options on the forums if you want to try them, although I regularly use a list view with about 2000 items with a fliter, sort and drag 'n' drop (on a subset) and there is no discernible lag when it's updating, it's very slick.
 

jmon

Well-Known Member
Licensed User
Longtime User
Ok. I will try to optimize my code and see if I can speed up the refresh time. Anyway thanks for your help.

Sent from my GT-P7500 using Tapatalk HD
 

Informatix

Expert
Licensed User
Longtime User
I see.... That's a pity then. It seems like a very basic feature missing. I guess I'll have to find another method. I was thinking that the gmail app was using a listview to display the emails but the must be using a scrollview then.

The ListView can take many forms. The B4A ListView is one of them. The missing function is a choice, and has nothing to do with performance or memory. A Java developper may add a function to edit items if he needs one.
 

jmon

Well-Known Member
Licensed User
Longtime User
I usually do not reply to feature requests (unless the request is not clear). I believe that it will be added in the future.

Thanks, that would be a great addition :)

Sent from my GT-P7500 using Tapatalk HD
 

stevel05

Expert
Licensed User
Longtime User
A Java developper may add a function to edit items if he needs one.

So can a B4A programmer, would a java implementation be any more efficient?

The ListView class relies on a ListAdapter, the process would presumably have to change the data wrapped with the ListAdapter then rebuild the ListView as we do currently in B4A. It would just be hidden behind a Java Wrapper.
 
Top