매우 구체적인 문제가 있습니다. Asus Nexus 7의 외부 저장소에 쓰기를 시도하고 있지만 장치의 에뮬레이트 된 디렉토리에 쓰고 있습니다. 내가 함수가 위의 실행됩니다 때 발생하는 기대 무엇 인 꽂혀 때이 장치를 다시 시작 할 때마다Android : Asus Nexus 7이 다시 시작할 때까지 에뮬레이트 된 메모리를 실행하지 않습니다.
public static void writeExternalMedia(Context context) {
if(isExternalStorageWritable()) {
String content = "hello world";
File filedir = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS) + "/test");
filedir.mkdir();
File file;
FileOutputStream outputStream;
try {
file = new File(filedir, "test.txt");
if (!file.exists()) {
file.createNewFile();
}
outputStream = new FileOutputStream(file);
outputStream.write(content.getBytes());
outputStream.close();
} catch (IOException e) {
e.printStackTrace();
}
}
는, 디렉토리가 장치 아래에 나타납니다 : 여기
내가 사용하고있는 코드입니다.나는 해결책을 찾으려고 노력했지만 내 질문에 대한 답을 찾을 수 없습니다.
나는 이것과 같은 것이라고 확신한다 : http://stackoverflow.com/questions/37946892/files-copied-by-my-app-not-showing-up-on-pc – Budius
나는 그 방법론을 활용했다. 불행히도 작동하지 않았습니다. 그래도 고마워! – eplewis89