The simplest solution I'm aware of, if there's a PDF viewer already installed, would be to save your byte array to file and request display of the file.
Something like this...
File pdfFile = new File(filePath);
if (pdfFile.exists()) {
Uri path = Uri.fromFile(pdfFile);
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(path, "application/pdf");
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
getActivity().startActivity(intent);
}
Of course you then need to tidy away the file when the PDF viewer activity is done. It may be possible to do this using
startActivityForResult
instead of
startActivity
.