@Override protected void onResume() { super.onResume(); updateOrderedDishCount(); if (mDishLstAdapter != null) { mDishLstAdapter.notifyDataSetChanged(); } }
private void updateDishes(final int position) { mDishes.clear(); mDishLstAdapter.notifyDataSetChanged(); new Thread() { public void run() { int ret = mDishes.setCategory( mCategories.getCategoryId(position), mCategories.getTableName(position)); handler.sendEmptyMessage(ret); } }.start(); }
public void handleMessage(Message msg) { if (msg.what < 0) { switch (msg.what) { case ErrorNum.DB_BROKEN: errorAccurDlg("菜谱数据损坏,请更新菜谱!", FINISH_ACTIVITY); break; default: Toast.makeText(MenuActivity.this, "服务器开小差了,系统将显示全部菜单.", Toast.LENGTH_SHORT).show(); } } mDishLstAdapter.notifyDataSetChanged(); }
private void updateDishQuantity(final int position, final int quantity) { if (quantity < 0) { new Thread() { public void run() { int ret = mMyOrder.minus(mDishes.getDish(position), -quantity); minushandler.sendEmptyMessage(ret); } }.start(); } else { mMyOrder.add(position, quantity); } updateOrderedDishCount(); mDishLstAdapter.notifyDataSetChanged(); }
public void handleMessage(Message msg) { mpDialog.cancel(); if (msg.what < 0) { errorAccurDlg("删除失败", DO_NOTHING); } else { switch (msg.what) { case 0: updateOrderedDishCount(); mDishLstAdapter.notifyDataSetChanged(); break; default: mpDialog.setMessage("正在删除..."); mpDialog.show(); } } }
public void onClick(View v) { final int position = Integer.parseInt(v.getTag().toString()); mMyOrder.add(mDishes.getDish(position), 1, Info.getTableId(), 0); updateOrderedDishCount(); mDishLstAdapter.notifyDataSetChanged(); }