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 onClick(View v) { final int position = Integer.parseInt(v.getTag().toString()); mMyOrder.add(mDishes.getDish(position), 1, Info.getTableId(), 0); updateOrderedDishCount(); mDishLstAdapter.notifyDataSetChanged(); }
private void updateOrderedDishCount() { mOrderedDishCount.setText(Integer.toString(mMyOrder.totalQuantity())); }