I have a logging app that saves data to a listview until the user saves it to a file.
But when the device is rotated, the ListView is cleared.
I could save the data in parallel to a list created in Starter but that would use twice the RAM. Since I want to be able to log as much data as memory allows, that is not the preferred way.
Ideally, I would like to be able to append new data to a file as it is received and prune the listview from old data but I have not found how to do that (append to a file) on B4A.
Alternately, if I could detect that the device is being rotated BEFORE the listview is cleared, I could save the data to a list in the Starter module and restore the listview content in Activity_Resume (and then clear the list to recover RAM).
At the moment, I simply freeze the orientation when the app starts, which is acceptable but not preferred.
But when the device is rotated, the ListView is cleared.
I could save the data in parallel to a list created in Starter but that would use twice the RAM. Since I want to be able to log as much data as memory allows, that is not the preferred way.
Ideally, I would like to be able to append new data to a file as it is received and prune the listview from old data but I have not found how to do that (append to a file) on B4A.
Alternately, if I could detect that the device is being rotated BEFORE the listview is cleared, I could save the data to a list in the Starter module and restore the listview content in Activity_Resume (and then clear the list to recover RAM).
At the moment, I simply freeze the orientation when the app starts, which is acceptable but not preferred.