Filefile=newFile(Environment.getExternalStorageDirectory().getAbsolutePath()+"/"+filename);Intenttarget=newIntent(Intent.ACTION_VIEW);target.setDataAndType(Uri.fromFile(file),"application/pdf");target.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);Intentintent=Intent.createChooser(target,"Open File");try{startActivity(intent);}catch(ActivityNotFoundExceptione){// Instruct the user to install a PDF reader here, or something}