android - I can not edit the listview need onContextItemSelected -
@override public boolean oncontextitemselected(menuitem item) { // adaptercontextmenuinfo info= // (adaptercontextmenuinfo)item.getmenuinfo(); // todo auto-generated method stub adaptercontextmenuinfo info = (adaptercontextmenuinfo) item .getmenuinfo(); switch (item.getitemid()) { case r.id.menu_delete: this.results.remove(info.position); arrayadapter<string> madapter = new arrayadapter<string>(this, android.r.layout.simple_list_item_1, results); setlistadapter(madapter); madapter.notifydatasetchanged(); return true; case r.id.menu_editar: this.results.add(info.position, null); arrayadapter<string> madapter1 = new arrayadapter<string>(this, android.r.layout.simple_list_item_1, results); setlistadapter(madapter1); madapter1.notifydatasetchanged(); return true; default: return super.oncontextitemselected(item); } }
i'm trying edit trip , stored in listview, manage delete not edit.
i appreciate or example.
thanks help
Comments
Post a Comment