안드로이드 개발 질문/답변
(글 수 45,052)
질문 던집니다.
AssetFileDescriptor 를 이용해 디스크립터를 취득 하려고 합니다.
FileNotFound 예외가 발생하는데 문제가 어디인지 발견을 못했습니다.
전제:
- sdcard 사용허가
- sdcard 디렉토리 확인
- /sdcard/download/test.txt 라는 파일도 있음
소스:
----------------------------------------------------------------------------------------------
Uri uri = Uri.parse("/sdcard/download/test.txt");
...
try {
...
AssetFileDescriptor afd = context.getAssets().openAssetFileDescriptor(uri, "r");
...
} catch (FileNotFoundException e) {
...
}
결과:
FileNotFoundException ......
어디가 잘못 되었는지 알려주시면 감사하겠습니다. ^^
AssetFileDescriptor 를 이용해 디스크립터를 취득 하려고 합니다.
FileNotFound 예외가 발생하는데 문제가 어디인지 발견을 못했습니다.
전제:
- sdcard 사용허가
- sdcard 디렉토리 확인
- /sdcard/download/test.txt 라는 파일도 있음
소스:
----------------------------------------------------------------------------------------------
Uri uri = Uri.parse("/sdcard/download/test.txt");
...
try {
...
AssetFileDescriptor afd = context.getAssets().openAssetFileDescriptor(uri, "r");
...
} catch (FileNotFoundException e) {
...
}
결과:
FileNotFoundException ......
어디가 잘못 되었는지 알려주시면 감사하겠습니다. ^^