gpt4 book ai didi

java - 文本文件出现错误 - 传输错误 : No such file or directory - DDMS

转载 作者:行者123 更新时间:2023-12-01 09:33:30 24 4
gpt4 key购买 nike

我正在尝试提取我的文本文件,该文件的名称是根据一篇文章的标题编写的,MACC 走在正确的轨道上,希望它能一路走好。txt 但在拉动时它给了我这个错误:

[2016-08-29 11:59:06 - ddms] transfer error: No such file or directory
[2016-08-29 11:59:06] Failed to pull selection: No such file or directory

当我尝试删除时

java.nio.BufferOverflowException
at java.nio.HeapByteBuffer.put(HeapByteBuffer.java:206)
at com.android.ddmlib.JdwpPacket.movePacket(JdwpPacket.java:235)
at com.android.ddmlib.Debugger.sendAndConsume(Debugger.java:347)
at com.android.ddmlib.Client.forwardPacketToDebugger(Client.java:707)
at com.android.ddmlib.MonitorThread.processClientActivity(MonitorThread.java:344)
at com.android.ddmlib.MonitorThread.run(MonitorThread.java:263)

我的源代码

public void storeHTML(Context context, ArrayList<String> storeHTML) {
try {
File root = new File(Environment.getExternalStorageDirectory(), "voicethenews");
if (!root.exists()) {
root.mkdirs();
}
File gpxfile = new File(root, storeHTML.get(0) + ".txt");
FileWriter writer = new FileWriter(gpxfile);
//BufferedWriter bufferedWriter = new BufferedWriter(writer);

for(int i = 1; i < storeHTML.size(); i++) {

//bufferedWriter.newLine();
writer.append(System.getProperty("line.separator") + storeHTML.get(i));

}

writer.flush();
writer.close();
Toast.makeText(context, "Saved", Toast.LENGTH_SHORT).show();
} catch (IOException e) {
e.printStackTrace();
}
}

我到处寻找答案,但仍然没有解决它。谢谢。

最佳答案

请测试此代码:

Environment.getExternalStorageDirectory().getAbsolutePath()+ "/SOME_DIRECTORY"

关于java - 文本文件出现错误 - 传输错误 : No such file or directory - DDMS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39198429/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com