@Override
  public void onClick(View v) {
    switch (v.getId()) {
      case R.id.downloaded_cancel:
        mLinearLayout.setVisibility(View.GONE);
        mLinearLayout.setPadding(0, 0, 0, 0);
        isEditor = false;
        adapter.setEditorState(isEditor);
        break;
      case R.id.downloaded_sure:
        mLinearLayout.setVisibility(View.GONE);
        mLinearLayout.setPadding(0, 0, 0, 0);
        // Integer[] deletePositions = delList.toArray(new Integer[delList
        // .size()]);
        //
        // Log.i("DownloadedFragment", "删除位置的集合:"+str);
        delLocalFile(delList);
        isEditor = false;
        adapter.setEditorState(isEditor);
        break;

      default:
        break;
    }
  }
  /**
   * 删除文件
   *
   * @param deletePositions 将要被删除的文件在listview的位置的集和
   */
  private void delLocalFile(List<DownloadedBean> delList) {
    //		int size = delList.size();
    //		String[] name = new String[size];
    // //使用迭代器的方式来历遍
    // Iterator<Integer> iterator = delList.iterator();
    // int i = 0;
    // while(iterator.hasNext()){
    // Integer position = iterator.next();
    // DownloadedBean bean = mList.get(position);
    // name[i] = bean.getName();
    // DBUtil.getInstance(getActivity()).deleteData(
    // SQLHelper.TABLE_DOWNLOADED, "name = ?",
    // new String[] { bean.getName() });
    // mList.remove(bean);
    // i++;
    // }

    for (DownloadedBean downloadedBean : delList) {
      //			DownloadedBean bean = delList.get(i);
      //			name[i] = bean.getName();
      DBUtil.getInstance(getActivity())
          .deleteData(
              SQLHelper.TABLE_DOWNLOADED, "name = ?", new String[] {downloadedBean.getName()});
    }
    mList.removeAll(delList);
    Log.i("DownloadedFragment", "删除后的mList集合:" + mList);
    // for (int i = 0; i < length; i++) {
    // mList.remove(mList.get(deletePositions[i]));
    // }
    deleteFile(delList);
    if (adapter != null) {
      adapter.notifyDataSetChanged();
    }
  }
  // 设置编辑栏的取消和确认按钮可见
  public void setLinearLayoutVisibility(int visibility) {
    isEditor = true;
    mLinearLayout.setVisibility(visibility);
    mLinearLayout.post(
        new Runnable() {

          @Override
          public void run() {
            int marginButtomHeight = mLinearLayout.getHeight();
            lv.setPadding(0, 0, 0, marginButtomHeight);
          }
        });
    adapter.setEditorState(true);
  }
 public void changeData() {
   Cursor cursor = DBUtil.getInstance(getActivity()).selectLastData(SQLHelper.TABLE_DOWNLOADED);
   while (cursor.moveToNext()) {
     DownloadedBean info = new DownloadedBean();
     info.setAuthor(cursor.getString(cursor.getColumnIndex("author")));
     info.setName(cursor.getString(cursor.getColumnIndex("name")));
     info.setProgramId(cursor.getString(cursor.getColumnIndex("program_id")));
     info.setStoragePath(cursor.getString(cursor.getColumnIndex("storage_path")));
     info.setThumb(cursor.getString(cursor.getColumnIndex("thumb")));
     info.setChecked_state(false);
     mList.add(info);
   }
   cursor.close();
   if (adapter != null) {
     adapter.notifyDataSetChanged();
   }
 }