2011-05-09 1 views

답변

2

여기 읽을 PDF 파일을 여는 방법을 보여주는 몇 가지 코드를입니다 :

private void openBook() { 
    File file = new File(mRealPath); 
    Uri path = Uri.fromFile(file); 
    Intent intent = new Intent(Intent.ACTION_VIEW); 
    intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); 
    intent.setDataAndType(path, getString(R.string.application_type)); 
    try { 
     startActivity(intent); 
    } catch (ActivityNotFoundException e) { 
     Toast.makeText(FirstTab.this, 
     getString(R.string.no_application_found), 
     Toast.LENGTH_SHORT).show(); 
    } 
}