android - Add delete function in my project -



android - Add delete function in my project -

i utilize code contextual menu , create simple commands. how integrate real commands in this?

i want create real function.

@override public void oncreatecontextmenu(contextmenu menu, view v,contextmenuinfo menuinfo) { super.oncreatecontextmenu(menu, v, menuinfo); menu.setheadertitle("optiuni"); menu.add(0, v.getid(), 0, "copiaza"); menu.add(0, v.getid(), 0, "sterge"); } @override public boolean oncontextitemselected(menuitem item) { if(item.gettitle()=="copiaza"){copyfunction(item.getitemid());} else if(item.gettitle()=="sterge"){deletefunction(item.getitemid());} else {return false;} homecoming true; } public void deletefunction(int id){ toast.maketext(this, "sters", toast.length_short).show(); } public void copyfunction(int id){ toast.maketext(this, "copiat", toast.length_short).show(); }

android file-management

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -