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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T22:56:34+00:00 2026-05-24T22:56:34+00:00

I have a problem with sending mms in android. I’ve seen many examples but

  • 0

I have a problem with sending mms in android. I’ve seen many examples but none of them are sending an image from res/drawable which is what I’m trying to do. Please help me spot the problem.

public class Main extends Activity {

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    Uri uri = Uri.parse("android.resource://com.mypackage/" + R.drawable.myimage);
    Intent sendIntent = new Intent(Intent.ACTION_SEND);
    sendIntent.putExtra("sms_body", "some text"); 
    sendIntent.putExtra(Intent.EXTRA_STREAM, uri);
    sendIntent.setType("image/png");
    startActivity(sendIntent);
}

Here are my error messages:

08-23 23:09:55.653: ERROR/AndroidRuntime(2205): FATAL EXCEPTION: main
08-23 23:09:55.653: ERROR/AndroidRuntime(2205): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.mms/com.android.mms.ui.ComposeMessageActivity}: java.lang.NullPointerException
08-23 23:09:55.653: ERROR/AndroidRuntime(2205): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
08-23 23:09:55.653: ERROR/AndroidRuntime(2205): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
08-23 23:09:55.653: ERROR/AndroidRuntime(2205): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
08-23 23:09:55.653: ERROR/AndroidRuntime(2205): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
08-23 23:09:55.653: ERROR/AndroidRuntime(2205): at android.os.Handler.dispatchMessage(Handler.java:99)
08-23 23:09:55.653: ERROR/AndroidRuntime(2205): at android.os.Looper.loop(Looper.java:123)
08-23 23:09:55.653: ERROR/AndroidRuntime(2205): at android.app.ActivityThread.main(ActivityThread.java:4627)
08-23 23:09:55.653: ERROR/AndroidRuntime(2205): at java.lang.reflect.Method.invokeNative(Native Method)
08-23 23:09:55.653: ERROR/AndroidRuntime(2205): at java.lang.reflect.Method.invoke(Method.java:521)
08-23 23:09:55.653: ERROR/AndroidRuntime(2205): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
08-23 23:09:55.653: ERROR/AndroidRuntime(2205): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
08-23 23:09:55.653: ERROR/AndroidRuntime(2205): at dalvik.system.NativeStart.main(Native Method)
08-23 23:09:55.653: ERROR/AndroidRuntime(2205): Caused by: java.lang.NullPointerException
08-23 23:09:55.653: ERROR/AndroidRuntime(2205): at com.android.mms.ui.UriImage.(UriImage.java:68)
08-23 23:09:55.653: ERROR/AndroidRuntime(2205): at com.android.mms.model.ImageModel.initModelFromUri(ImageModel.java:82)
08-23 23:09:55.653: ERROR/AndroidRuntime(2205): at com.android.mms.model.ImageModel.(ImageModel.java:64)
08-23 23:09:55.653: ERROR/AndroidRuntime(2205): at com.android.mms.data.WorkingMessage.changeMedia(WorkingMessage.java:461)
08-23 23:09:55.653: ERROR/AndroidRuntime(2205): at com.android.mms.data.WorkingMessage.setAttachment(WorkingMessage.java:362)
08-23 23:09:55.653: ERROR/AndroidRuntime(2205): at com.android.mms.ui.ComposeMessageActivity.addImage(ComposeMessageActivity.java:2640)
08-23 23:09:55.653: ERROR/AndroidRuntime(2205): at com.android.mms.ui.ComposeMessageActivity.addAttachment(ComposeMessageActivity.java:2776)
08-23 23:09:55.653: ERROR/AndroidRuntime(2205): at com.android.mms.ui.ComposeMessageActivity.handleSendIntent(ComposeMessageActivity.java:2705)
08-23 23:09:55.653: ERROR/AndroidRuntime(2205): at com.android.mms.ui.ComposeMessageActivity.initialize(ComposeMessageActivity.java:1743)
08-23 23:09:55.653: ERROR/AndroidRuntime(2205): at com.android.mms.ui.ComposeMessageActivity.onCreate(ComposeMessageActivity.java:1678)
08-23 23:09:55.653: ERROR/AndroidRuntime(2205): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
08-23 23:09:55.653: ERROR/AndroidRuntime(2205): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
08-23 23:09:55.653: ERROR/AndroidRuntime(2205): … 11 more

  • 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-05-24T22:56:35+00:00Added an answer on May 24, 2026 at 10:56 pm

    you cannot expose application resources directly to the outside world.

    you can try implementing a content provider. LINK

    using this you can send you own custom uri and when the file is searched you can open the file from your resources and supply it.

    you have to check the manifest.xml as well for the relative entry of the content provider.

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

Sidebar

Related Questions

I have problem while sending messages from android to PC. Messages are send when
greetings all i have a problem that when sending an email from the server
I have problem with sending objects via TCPClient. At first, I serialize them into
I have a problem sending email from a linux machine. The application sends several
I have a pretty peculiar problem with sending a SMS from the iPhone programmatically,
I have problem with sending a object from my webservice. I have created a
I have no problem sending emails from within my app. Right now it requires:
I have a little problem with sending an extra from one activity to another.
I have problem creating new instance of excel 2007 using VBA (from Access 2002).
I have problem sending emails, i checked the email sending error logs, and I

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.