android - Refresh listview onpost execute asynctask -
i know question has been posted multiple times , browsed of them there not result, performing deleting item mysql database not refreshing, here code of onclicklistener , button:
onclick listener:
holder.void_button.setonclicklistener(new onclicklistener(){ public void onclick(view v) { adapter = new customlistviewvoidadapter(context,r.layout.mytemp, items); item_selected= items.get(position); new deleteorder().execute(); }}); vi.settag(holder); }
onpostexecute asynctask:
protected void onpostexecute(string unused){ adapter.remove(item_selected); adapter.notifydatasetchanged(); }
the adapter instatiated globally, can please check problem might be? not returning error, deleting item , not refreshing.
regards
ralph
throwing out there, but, have tried adapter.notifydatasetinvalidated();? forces update.
also, put code in asynctask!
like such:
protected void onpostexecute() { adapter.notifydatasetchanged(); adapter.notifydatasetinvalidated(); }
Comments
Post a Comment