I'm trying to remove an item from an Text file using an arrayList. The ArrayList get's its values from the Text File, and then it displays it in a ListView.
I have a contextual menu that pops up, and gives me an option to remove the item from the list.
In the text file, all the items are on a new line.
How will I go about removing specific items from the file? The ArrayList will clear it's self, and pull the data into the ArrayList when ever the action has been performed, so that is sorted.
Code to remove item from array:
int id = info.position;
for(int i = array.size()-1; i >=0; i--){
array.remove(id);
}
ArrayListand then write back to the file.