2012-12-08 161 views

回答

0

你可以用這個做到這一點:

Intent intent = new Intent(Intent.ACTION_VIEW); 
intent.setDataAndType(path, "application/filetype"); 
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); 


try { 
    startActivity(intent); 
} 
catch (ActivityNotFoundException e) { 
    Toast.makeText(OpenPdf.this, 
     "No app available", 
     Toast.LENGTH_SHORT).show(); 
} 
相關問題