Android Question Problem with returning in Cards CustomListView

Alexander Stolte

Expert
Licensed User
Longtime User
what is the purpose of the sub “soortmenu” in the “nieuw” activity? You create an array on the main activity (nm(20) As String), add your 2 values at position 0 and 1 and fill the list. Then you open an item and there you add completely different values to the array from position 0-20 and are then surprised that the buttons no longer work because the content in the array has changed and the values at position 0 and 1 are no longer the same as at the beginning.

My advice is to delete the CustomListView items and rebuild it when you change your array, because you have added new values to the array that you are not displaying?
I don't quite understand what your goal is
 
Upvote 0

parijs

Active Member
Licensed User
Longtime User
The species.db gives a list of food and that takes me to a value input field and fills in the favo.db and then has to go back to main

What I want is to get back to the first menu in main and that the buttons work
 
Upvote 0

Alexander Stolte

Expert
Licensed User
Longtime User
I described to you why it doesn't work, but even after your description I don't understand why you populate the array with new values and then don't recreate the list on the main activity
 
Upvote 0

Alexander Stolte

Expert
Licensed User
Longtime User
To see the problem you should set a break point in the sub “Panelmenu_Click” in the main acitivty at the point “naam = nm(index)” and compare the values of the array before the 1st opening and after the 1st opening, then you will see what the problem is.
 
Upvote 0

Alexander Stolte

Expert
Licensed User
Longtime User
Your array on the first click on a item:
1738253755738.png


Your array after calling soortmenu in the nieuw activity:
1738253851322.png


i hope you see the problem now.
 
Upvote 0
Top