//添加文件到文件库
public boolean onGroupClick(ExpandableListView parent, View v,
int groupPosition, long id) {
if (doWhat == FILE_LIB_ADD) {
ArrayList child =
childList.get(groupPosition);
if (!fm.isMultFile()) {
if (child.contains(path)) {
Toast.makeText(fm, path + "已存在",
Toast.LENGTH_SHORT).show();
return false;
}
child.add(path);
} else {
ArrayList fis =
fileManager.currentFileInfo();
ArrayList fTmp =
fileManager.selectedItem();
int size = fTmp.size();
String tmp;
for (int i = 0; i < size; i++){
tmp = fis.get(fTmp.get(i)).path();
if (child.contains(tmp)) {
continue;
}
child.add(tmp);
}
}
FileLibDialog.this.dismiss();
return true;
}
return false;
}
});
![](https://profile-avatar.csdnimg.cn/default.jpg!4)
麻烦帮我注释一下代码,谢谢了
- 写回答
- 好问题 0 提建议
- 追加酬金
- 关注问题
- 邀请回答
-
2条回答 默认 最新
- threenewbee 2015-01-11 13:20关注
//添加文件到文件库
public boolean onGroupClick(ExpandableListView parent, View v,
int groupPosition, long id) {
if (doWhat == FILE_LIB_ADD) { //文件添加到库中
ArrayList child =
childList.get(groupPosition);
if (!fm.isMultFile()) { //是否选择了多个文件
if (child.contains(path)) { //是否包含了路径
Toast.makeText(fm, path + "已存在", //文件已经存在
Toast.LENGTH_SHORT).show();
return false;
}
child.add(path); //添加文件
} else {
ArrayList fis =
fileManager.currentFileInfo(); //添加当前文件信息
ArrayList fTmp =
fileManager.selectedItem(); //选中的
int size = fTmp.size();
String tmp;
for (int i = 0; i < size; i++){
tmp = fis.get(fTmp.get(i)).path(); //循环获得文件路径
if (child.contains(tmp)) {
continue;
}
child.add(tmp);
}
}
FileLibDialog.this.dismiss(); //关闭对话框
return true;
}
return false;
}
});解决 无用评论 打赏 举报
悬赏问题
- ¥20 Html备忘录页面制作
- ¥15 黄永刚的晶体塑性子程序中输入的材料参数里的晶体取向参数是什么形式的?
- ¥20 数学建模来解决我这个问题
- ¥15 计算机网络ip分片偏移量计算头部是-20还是-40呀
- ¥15 stc15f2k60s2单片机关于流水灯,时钟,定时器,矩阵键盘等方面的综合问题
- ¥15 YOLOv8已有一个初步的检测模型,想利用这个模型对新的图片进行自动标注,生成labellmg可以识别的数据,再手动修改。如何操作?
- ¥30 NIRfast软件使用指导
- ¥20 matlab仿真问题,求功率谱密度
- ¥15 求micropython modbus-RTU 从机的代码或库?
- ¥15 django5安装失败