//添加文件到文件库
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;
}
});
//添加文件到文件库
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;
}
});
再帮我注释一下这个,谢谢了 0.0
//apk安装
String name = apkInfos.get(pos).packageName;
Intent intent = pm.getLaunchIntentForPackage(name);
if (intent == null){
Log.d(tag, "can not get intent: " +
name);
return;
}
ApkDialog.this.dismiss();
startActivity(intent);
}
});
//apk卸载
Uri uri = Uri.fromParts("package",
apkInfos.get(pos).packageName,
null);
Intent intent = new Intent(Intent.ACTION_DELETE, uri);
ApkDialog.this.dismiss();
startActivity(intent);
}
});