After reading through several Q/A, I still can't find a suitable answer for my current issue.
I have a pdf-file (known at compile time) which is stored in my /res/raw folder.
I have tried loading the file using:
InputStream is = getResources().openRawResource(R.raw.mypdf);
Then I want to display the pdf (in an intent) using the preferred pdf-reader on the device:
Intent i;
i = new Intent(Intent.ACTION_VIEW);
i.setDataAndType(file,"application/pdf");
startActivity(i);
The issue is that the intent takes in the type 'File', while my pdf is read as an 'InputStream'.
The question is: How can i display the pdf-file? i.e. how can I display an InputStream? or how can I store the pdf-file to allow opening with new File()?