@Override
public boolean onContextItemSelected(MenuItem item) {
if(item.getTitle()=="Remove"){
AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo();
quotesAdapter.remove(quotes.get((int)info.id));
quotesAdapter.notifyDataSetChanged();
listView.setAdapter(quotesAdapter);
serializeQuotes();
}
else {
return false;
}
return true;
}
何もしません。追加すると
this.quotesAdapter = new QuoteAdapter(this, R.layout.mainrow, quotes);
削除は機能しますが、正しい方法ではないと思います。何が悪いのかわからない?