public void delete() { TaskPoint point = mExpandListAdatpger.getTaskPoint(groupPosition, childPosition); TaskDetail detail = mExpandListAdatpger.getTaskDetail(groupPosition); String path = SdcardUtil.getSdcardCollInfo() + detail.getId() + "/" + point.getIname(); mTaskPage.deletePhoto(path); mTaskPage.deletePhoto(SdcardUtil.getSdcardCollInfo() + detail.getId()); DManager.getInstance(mContext).deletePoint(point.getCameraId()); }
/** 从数据库中获取要显示的数据 */ private void setTaskDetail(int start, int end) { arrayListOld.clear(); ArrayList<TaskDetail> details = DManager.getInstance(mContext).queryAllOldTaskByLimit(start, end); if (details.size() > 0) this.start = end; for (int i = 0; i < details.size(); i++) { TaskDetail taskDetail = details.get(i); ArrayList<TaskPoint> points = DManager.getInstance(mContext).queryPoint(taskDetail.getId(), MColums.OLD); if (points.size() == 0) { DManager.getInstance(mContext).deleteOldTaskDetail(taskDetail.getId()); continue; } taskDetail.setList(points); arrayListOld.add(taskDetail); } mExpandListAdatpger.notifyDataSetChanged(); }
/** 本地数据库中统计已提交任务的数量 */ private void setTotal() { size = 0; // 数据中获取总计提交数 ArrayList<TaskDetail> t_list = DManager.getInstance(mContext).queryAllOldTask(MColums.OLD); int p_size = DManager.getInstance(mContext).queryOldPoint(MColums.OLD).size(); for (int i = 0; i < t_list.size(); i++) { ArrayList<TaskPoint> p_list = DManager.getInstance(mContext).queryPoint(t_list.get(i).getId(), MColums.OLD); for (int j = 0; j < p_list.size(); j++) { Double double1 = FileSizeUtil.getFileOrFilesSize( SdcardUtil.getSdcardCollInfo() + t_list.get(i).getId() + "/" + p_list.get(j).getIname(), FileSizeUtil.SIZETYPE_MB); size = size + double1; } } setTaskSize(t_list.size(), p_size, df.format(size)); }
/** 从数据库中获取要显示的数据 */ private void setTaskDetail() { ArrayList<TaskDetail> details = DManager.getInstance(mContext).queryAllOldTaskByLimit(start, end); ArrayList<TaskPoint> points = null; if (details.size() > 0) start = start + 20; for (int i = 0; i < details.size(); i++) { TaskDetail taskDetail = details.get(i); points = DManager.getInstance(mContext).queryPoint(taskDetail.getId(), MColums.OLD); if (points.size() == 0) { DManager.getInstance(mContext).deleteOldTaskDetail(taskDetail.getId()); continue; } taskDetail.setList(points); arrayListOld.add(taskDetail); } if (details.size() > 0) { setTaskSize(details.size(), points.size(), String.valueOf(0)); } if (arrayListOld.size() == 0) expandableListView.setVisibility(View.GONE); handler.sendEmptyMessageDelayed(wait_pr0bar, 1000); mExpandListAdatpger.notifyDataSetChanged(); }