Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Intent emailIntent = new Intent(Intent.ACTION_SEND);
- // emailIntent.setType("text/plain");
- emailIntent.putExtra(Intent.EXTRA_EMAIL, emails);
- emailIntent.putExtra(Intent.EXTRA_SUBJECT, "Receipt Voucher from Vawsum");
- emailIntent.putExtra(Intent.EXTRA_TEXT, "Please find the receipt voucher attached along with this mail.");
- Uri outputFileUri = FileProvider.getUriForFile(this, BuildConfig.APPLICATION_ID + ".fileprovider", new File(String.valueOf(new File(String.valueOf(pdfDir), "VawsumVoucher.pdf"))));// - akash - to send third party apps big size files
- emailIntent.putExtra(Intent.EXTRA_STREAM, outputFileUri);
- emailIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
- emailIntent.setType("application/pdf");
- startActivity(Intent.createChooser(emailIntent, "Send Email"));
- <provider
- android:name="android.support.v4.content.FileProvider"
- android:authorities="com.trakkerz.app.fileprovider"
- android:exported="false"
- android:grantUriPermissions="true"
- tools:replace="android:authorities">
- <meta-data
- android:name="android.support.FILE_PROVIDER_PATHS"
- android:resource="@xml/provider_paths"
- tools:replace="android:resource"/>
- </provider>
Add Comment
Please, Sign In to add comment