My ListView populates correctly, but for some reason adding and removing is quirky and does not work properly! Am I doing something wrong?
Set things up in OnCreate(
The code seems to be alright. Can you try using this in your remove?:
if("Remove".equals(item.getTitle())) {
//....
}
Edit:
I just noticed you are de-serializing "Quote" objects by calling deserializeQuotes()
. Have you overridden the boolean equals(Object)
method of Quote object? When you de-serialize, the object created are not the "same", i.e. they are new objects altogether and if you haven't overridden the equals method:
quotesAdapter.remove(quotes.get(info.position));
will fail because it won't find any Quote object to remove in the list.
Can you check that?