I cant delete the listview selection after adding images to listview elements

i cannot delete the listview selection after addind images to listview elements
HERE ARE THE BLOCKS


image

HERE IS THE INITIALIZE
image

You are trying to find an index in the list? This does not make sense...
You will not find it, therefore 0 will be returned

Why not directly removing the selected index?

Taifun

still the same issue

it was working before adding images to the listview

Use Do it to debug your blocks
Why is your SelectionIndex 0?
Did you select something from the listview?

unknown
unknown2

use Do it to debug your blocks, see also tip 4 here App Inventor: How to Learn | Pura Vida Apps
see also Live Development, Testing, and Debugging Tools
Taifun

finaly i fin the solution

Perform your if-then code before attempting to remove the List Item.

@Taifun i figured out the issue it was in the reverse list, it works well now without reversing the list but when i added the reverse list its deleting the reverse index as well so any ideas about reversing the list or adding the new in the top?


image

try this

unknown

what about using Do it to debug your blocks?
Taifun

its showing the exact index but didnt delete anything after adding the reverse as you recomennded
image

show us the global chatmessages.

Is it a list?

or try like this

image

before delete you can verify that whether the selected item is in the list or not, if it exists then you can delete else you can show one notifier

here the global name2 is your global chat messages

yes the gobal chat messages worked is a list when i removed the reverse list but i wanna a way to add the new items above
its deleting but deleting the reverse index as i added the reverse in the cloud got value and data changed
its working well and deleting the exact index when i remove the reverse list

Above mean?

have you tried this block
image

as using append value to list so couldn't try it

as always it is advisable to create a small test project, in this case for example with 3 list items, reverse the list, delete an item, display the list again

use Do it to find out, how the list looks like before removing an item and after

Taifun

append value mean you can add at the end only. else you insert items into the list then save into the clouddb

1 Like

List items

1 >< 5
2 >< 4
3 >< 3
4 >< 2
5 >< 1

think it through...

1 Like

I figured it out, Finally it works like that