Listview selection error

Not the Refresh block.

These blocks:
lista_borrar2

When you load lista_numbers into the ListView1.Elements the first time, it loads successfully.

(Edited) But if you delete items from Elements list and reload the ListView, it no longer loads correctly.

Borrar_Elemento_Lista_2.aia (2.5 KB)

1 Like

@Susan_Lane Today release nb188 ; Look same problem still there...

Here's a sample listview aia with the error...

"Attempt to invoke virtual method void
androidx.cardview.widget.CardView.set BackgroundColor(int) on a null object reference"
Listview.aia (1.9 KB)

I am not setting any background color for the listview.

Just setting visibility on or off and selecting an item by selection or index via blocks.

Well, you have to refresh the "lista_numbers" after having modified it because handling with lists means dealing with adresses not with values. Assigning the "lista_numbers" to the "ListView.Elements" means passing an adress. All what happens to that will happen to the original one "lista_numbers". Or start with:
ListView.Elements=copy list(lista_numbers); then you won't have to refresh the "lista_numbers".


:slight_smile:

2 Likes

@Susan_Lane I found that this bugs start +- 2021-11-11; why not incharge person roll back to previous version first and slowly check the bugs ?

It works fine in version 2.61 of the Companion App but I have the same problem in version 2.62

I'm investigating.

In our major fall release, there was a big update to ListView. It's not surprising that we're finding bugs. I appreciate the reports.

Hi, listview update with image is cool ! thanks AI
But I also encountered " attempt to invoke virtual ....BackgroundColor(int)' on a null object reference.
Using listcopy did not solve the problem for me. In my case, Crash occurs when using the the "set listview. selected Index" command which fires a null object error.
This does not occur with the "get listview.selected Index" command which returns the good, value.
Selected index will stay unshaded after a listview refresh, but that will do for me until AI kindly takes care of this little problem.

Enclosed example displays data form a dictionary. bloc which causes problem is disabled
Regards.
testListView.aia (58.9 KB)

Hi everybody
The problem is not yet resolved
Please is there any solution?