У меня была та же проблема, но я использовал ListView в сочетании с ArrayAdapter, чтобы вернуть полный путь к файлу.Когда я попытался передать путь как «SDCARD:», за которым следовал путь к файлу, он не смог найти файл, так как метод, похоже, больше не поддерживается новыми версиями CWM Recovery.Я нашел легкий обходной путь, хотя:
public boolean installPackage(String pos) throws InterruptedException {
final String location = "/emmc/" + pos.substring(11);
Process process = null;
try {
process = Runtime.getRuntime().exec("su");
DataOutputStream os = new DataOutputStream(process.getOutputStream());
os = new DataOutputStream(process.getOutputStream());
os.writeBytes("echo 'install_zip(\"" + location + "\");'" + " > /cache/recovery/extendedcommand\n");
os.writeBytes("reboot recovery\n");
os.writeBytes("exit\n");
os.flush();
return (process.waitFor() == 0);
} catch (IOException e) {
// TODO Auto-generated catch block
Log.e("FLASH:", "Unable to boot into recovery");
e.printStackTrace();
}
return false;
}