Problem with List

fanfalveto

Active Member
Licensed User
Longtime User
I do that
B4X:
Dim lista As List
then
B4X:
lista.Initialize
I fill the list
B4X:
lista.Add(elapsedtotal)
   lista.Sort(True)
then i call a service (in list there are time elpsed from now to 5 minutes for example and from now to 10 minues).the service has a timer,the first position of the list runs ok,but when the service returns to read the second line from the list in the activity the list is empty.
I put logs and the list fills ok,but when i finished the activity for wait the service timer and after returns again is empty.Please can you help me?
 

mc73

Well-Known Member
Licensed User
Longtime User
Where do you grab your list from? I would try setting and getting the list from a db (sqlite) or even a text file.
 
Upvote 0

fanfalveto

Active Member
Licensed User
Longtime User
i put in list a float.
insert data ok (1,2,3....),but if i finish the activity the size of list return to 0
 
Upvote 0

mc73

Well-Known Member
Licensed User
Longtime User
This is natural. Activity gets finished (and probably killed). I recommend you saving the list to a file, and getting it back to the service from there.
 
Upvote 0

fanfalveto

Active Member
Licensed User
Longtime User
The activity is finish not killed,but i don´t undestand why if i work with an Long array and i finished the activity when restart the array is full,but if i work with a list the list is empty.
The list is better for me because i need order the data and i don´t know how to order a array of Long numbers
 
Upvote 0

fanfalveto

Active Member
Licensed User
Longtime User
sure,you can click on the image to enter,then click an a day (the calendar is copied from an user in this forum),i´m trying to make an diary with alarms with this.
thank you very much for your time
 
Upvote 0

mc73

Well-Known Member
Licensed User
Longtime User
Unfortunately I haven't upgraded my b4a version yet, so I cannot run your app. I hope others here can provide help. By the way, do you dim your list in process_globals or not?
 
Upvote 0

fanfalveto

Active Member
Licensed User
Longtime User
I try another thing an experiment with threads,but not.
Yes i save the list in a file and read after.
Thank you
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…