Question

I'm looking to save some information from a ListView to a file and was hoping for a recommendation. I have several items on my ListView and I would like to save at least 3 values for each - the position in the list view, the title (text) that the item has in the ListView, and the file name including the path (because each ListView entry relates to a file that is loaded when a click event takes place).
Still learning, but I was playing with Maps earlier on and since then the project has grown where a key and value may not be enough.

Was it helpful?

Solution

You can create a custom type that holds all the required values for each item. You should add an object of that type as the return value (AddSingleLine2...). You have several options for saving the items to a file. One option is to create a List with all the items and use RandomAccessFile.WriteObject to write it to a binary file.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top