Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9174879
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:49:26+00:00 2026-06-17T16:49:26+00:00

I have to open my application e-mail (G-mail) and it must be attached to

  • 0

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);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T16:49:26+00:00Added an answer on June 17, 2026 at 4:49 pm

    Most of your code looks right. Two things:

    When you create the PDF file in your app’s local filesystem, you need to create it with the MODE_WORLD_READABLE flag. This is needed for the other application to be able to open the PDF.

    Then use Uri.fromFile to get an Android URI to your file (you have this in commented code).

    Note that MODE_WORLD_WRITEABLE is considered a poor security practice, because ANY app on the device will be able to access your PDF file. A better solution would be to create a ContentProvider and use a content: URI to serve the PDF data to the external application. This gives you control over whether to permit or deny access for any individual load of the PDF file (but it’s a bit more work).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created an html5 application in which I open an pdf, after opening
I have open pdf file through my application.when click on device back button it
I have created a facebook website open graph application for my website www.heyngine.com. The
I have one interesting problem. I must parse mail body (regular expression), get some
I have built an open-source application from the source code. Unfortunately, the original executable
When no users have the any pages in an application open, it will unload
Suppose I have two Java projects in Maven / Eclipse: An open source application
I am developing android application in which i have to open option menu from
I have a 64 bit Enterprice SuSE 11 I have an application which open
I have a console application which can also open winform under certain conditions.Processing(its a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.