2012-02-09 5 views
1

pdf 파일을 내 자산 폴더에두고 읽을 의도가 있습니다. 나는이 작업을 수행 할 때까지 APOPPDF 파일을 android의 assets 폴더에 저장합니다.

Uri path = Uri.parse("file:///android:asset/about.pdf"); 
    Intent intent = new Intent(Intent.ACTION_VIEW); 
    intent.setDataAndType(path, "application/pdf"); 
    intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); 
    startActivity(intent); 

어도비 리더 을 포함하여 응용 프로그램의 목록이 나타납니다하지만 난 그것을 클릭하면, 대화 상자가 말하는 나타납니다 : 여기 내 코드입니다 "오류"파일 경로가 아닙니다

유효

방법이

+0

중복 ... http : //stackoverflow.com/questions/3831019/how-to-read-a-pdf-in-android – himanshu

+0

나는 이것을 시도했다 - File file = new File ("file : /// android : asset/about.pdf "); – Ankit

+1

http://stackoverflow.com/questions/6491210/how-to-open-a-pdf-stored-either-in-res-raw-or-assets-folder –

답변

관련 문제