我的要求是文件格式为filename.extension(.png,.mp4.mp3,txt,.....等)。
我想知道我该怎么做。如何在android中为FileOutputStream动态设置文件名?
示例代码行:
File extStore = Environment.getExternalStorageDirectory();
FileOutputStream fos = new FileOutputStream(extStore + "/Get_file/filename.jpg");
给我上面的方法?
我不知道我理解你的问题,但是这一点在这里'“/Get_file/filename.jpg”'是一个字符串,所以你可以根据用户的输入或者你用来确定正确的文件名来动态地构造该字符串。 – panonski