/** bind onClickListener for checkBox set full-checked state */ public void onCheckboxClicked(View view) { if (checkBox.isChecked()) { ToastUtil.showToast(this, checkBox.isChecked() + ""); for (GoodsInformation singleData : adapterData) { singleData.setSelected(true); } adapter.setFullChecked(true); adapter.notifyDataSetChanged(); } else { ToastUtil.showToast(this, checkBox.isChecked() + ""); for (GoodsInformation singleData : adapterData) { singleData.setSelected(false); } adapter.setFullChecked(false); adapter.notifyDataSetChanged(); } }
/** * bind onClickListener for delete-items Button * * @param view */ public void deleteOnClickListener(View view) { // delete selected items and keep the same with Server synchronized String nums = setSelectedData(); // Thread to communicate with Server deleteDataInLocal(nums); // test ToastUtil.showToast(this, nums); }
/** * bind onClickListener for showOnMap Button * * @param view */ public void showOnMapOnClickListener(View view) { // upload selected items to server and get optimized route String nums = setSelectedData(); // test ToastUtil.showToast(this, nums); // jump to MainActivity with optimized route Intent intent = new Intent(this, MainActivity.class); startActivity(intent); }