I have to open my application e-mail (G-mail) and it must be attached to some pdfs
the pdf are located in a folder created by the application. the folder is not created on sdcard.
My tablet does not have sdcard. My tablet does not have sdcard. My tablet does not have sdcard.
how to send these pdfs for email?
if(android.os.Environment.getDataDirectory().equals(android.os.Environment.MEDIA_MOUNTED))
cacheDir=new File(android.os.Environment.getDataDirectory(),"MyAPP");
//String FILENAME = "testejan1.pdf";
//String string = "hello world!";
//File file = new File (Environment.getDataDirectory().getPath(), "/MyAPP/"+"testejan1.pdf");
//Uri path = Uri.fromFile(file);
Intent shareIntent = new Intent(Intent.ACTION_SEND);
shareIntent.setType("application/pdf");
//shareIntent.setAction(Intent.ACTION_SEND);
shareIntent.putExtra(Intent.EXTRA_EMAIL, new String[] { "flip_novidade@hotmail.com" });
shareIntent.putExtra(Intent.EXTRA_SUBJECT, "Material de apoio do mês de " + mesclicado);
shareIntent.putExtra(Intent.EXTRA_TEXT, "Você esta recebendo um super material de visitação médica");
//shareIntent.setDataAndType(path, "application/pdf");
shareIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse("file:///MyAPP/"+"testejan1.pdf"));
//shareIntent.setType("file/*");
startActivity(shareIntent);