I’m using a list view to displace names. The user needs to be able to add a name to the bottom of the list view and to be able to delete names within. The names are saved using SharedPreferences and loaded into an original string array which I then load to an ArrayAdapter. The problem with this method is that, unless I fill up the entire string array, I get a NPE for the ArrayAdapter. So my solution was to set the string array to only be as big as the number of names. This means, however, that I cannot add a name to the list, as the list is only so long.
What’s the best way to be able to add and remove strings from a list view and still be able to tell what they are?
After changing values of
listviewdata please put code