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 8883821
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T20:54:36+00:00 2026-06-14T20:54:36+00:00

Im trying to send an MMS with a picture that I have saved to

  • 0

Im trying to send an MMS with a picture that I have saved to the SDcard and while opening the messaging service I get the statement “Sorry you cannot add this picture to your message” and it doesn’t attach the file. I’ve tried parsing the file into a uri, tried passing the file directly into the MMS intent, and a few other things. I’m not sure what I’m missing and I’m pretty certain it is saving it as I can see the file in the File Viewer. Do I have to make the image available to the mediastore by scanning it (prefer not to put it in the image gallery), do I have to open the file first before passing it in? A little direction as to what I should be doing would be appreciated.

My file

private static final String FILENAME = "data.pic";
File dataFile = new File(Environment.getExternalStorageDirectory(), FILENAME);

Saving the image

// Selected image id
int position = data.getExtras().getInt("id");
ImageAdapter imageAdapter = new ImageAdapter(this);
ChosenImageView.setImageResource(imageAdapter.mThumbIds[position]);
Resources res = getResources();
Drawable drawable = res.getDrawable(imageAdapter.mThumbIds[position]);
Bitmap bitmap = ((BitmapDrawable)drawable).getBitmap();
ByteArrayOutputStream stream = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.PNG, 100, stream);
byte[] bitmapdata = stream.toByteArray();
try {
    File file = new File(dataFile, FILENAME);
    file.mkdirs();
    FileOutputStream fos = new FileOutputStream(file);
    fos.write(bitmapdata);
    fos.close();
 }catch (FileNotFoundException e) {
 e.printStackTrace();
 } catch (IOException e) {
 e.printStackTrace();
 }

}

Where I want to attach it and my current attempt

// Create a new MMS intent
Intent mmsIntent = new Intent(Intent.ACTION_SEND);
mmsIntent.putExtra("sms_body", "I sent a pic to you!");
mmsIntent.putExtra("address", txt1);
mmsIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(new File(FILENAME)));
mmsIntent.setType("image/png");
startActivity(mmsIntent);
}};
  • 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-14T20:54:37+00:00Added an answer on June 14, 2026 at 8:54 pm

    Aaah Sorry, You can’t.

    Problem:

    The new File(FILENAME) is doesn’t exist.

    Look at these three different Files code lines..

    1. File dataFile = new File(Environment.getExternalStorageDirectory(), FILENAME);
    
    2. File file = new File(dataFile, FILENAME);
    
    3. Uri.fromFile(new File(FILENAME))
    

    All are have difference reference.

    Solution:

    Change your code

    try {
         File file = new File(dataFile, FILENAME); 
         file.mkdirs(); // You are making a directory here
         FileOutputStream fos = new FileOutputStream(file); // set Outputstream for directory which is wrong
         fos.write(bitmapdata);
         fos.close();
        }catch (FileNotFoundException e) {
         e.printStackTrace();
        } catch (IOException e) {
          e.printStackTrace();
        }
    

    With

    try {
          FileOutputStream fos = new FileOutputStream(dataFile);
          fos.write(bitmapdata);
          fos.close();
         }catch (FileNotFoundException e) {
          e.printStackTrace();
         } catch (IOException e) {
          e.printStackTrace();
        }
    

    And the Main code lines for send MMS,

    if(dataFile.exists())
    {
     Intent mmsIntent = new Intent(Intent.ACTION_SEND);
         mmsIntent.putExtra("sms_body", "I sent a pic to you!");
         mmsIntent.putExtra("address", txt1);
         mmsIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(dataFile));
         mmsIntent.setType("image/png");
         startActivity(mmsIntent);
    }
    

    Just use only one dataFile File reference for all your Code.

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

Sidebar

Related Questions

Trying to send a complex type between two systems that have the same code
I am currently trying to send a MMS message to a cell phone (via
I`m trying to send simple html page with form data to user with GET,
im trying to send rest api Users.getLoggedInUser i have all the secret session and
i am trying to send MMS using code sample from here . I am
While trying to send a POST request via xmlhttp.open(POST, url, true) (javascript) to the
Im trying to send an email to multiple addresses, so I wrote function that
Im trying to send a get request and get the content of a webpage.
Hi so I'm trying to send an image (png) from the sdcard in an
I'm working on an Android application that will send MMS internally without using the

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.