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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T11:46:58+00:00 2026-06-14T11:46:58+00:00

I’m currently developping an application in which I can send SMS and email. No

  • 0

I’m currently developping an application in which I can send SMS and email.
No big deal, that’s quite easy to do.
Here is how I send the SMS:

private void sendSms() {
    Log.i("", "SEND SMS");
    Intent intent = new Intent(Intent.ACTION_VIEW, 
            Uri.parse("sms:123456789"));
    intent.putExtra("sms_body", "My message");
    startActivity( intent );
}

Here is my code to send an email:

private void sendEmail() {
    Log.i("", "SEND");
    Intent email = new Intent(Intent.ACTION_SEND);
    email.putExtra(Intent.EXTRA_EMAIL, "address@fuu.com");
    email.putExtra(Intent.EXTRA_SUBJECT, "Subject");
    email.putExtra(Intent.EXTRA_TEXT, "My body email");
    email.setType("message/rfc822");
    startActivity(Intent.createChooser(email, "Send an email:"));
}

Independently, those work great.

But I want to send my email once my SMS is sent or canceled.
I can’t find how I can get back the close event of the SMS intent/activity to send the email.
Any idea ?

  • 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-14T11:46:59+00:00Added an answer on June 14, 2026 at 11:46 am

    You should use the startActivityForResult when starting this kind of activities.

    You can then get the result of the started activity by implementing the onActivityResult method

    The flow will be something like the following

    1) startActivityForResult( SEND_SMS_INTENT, SEND_SMS_REQUEST_CODE ) where SEND_SMS_REQUEST_CODE is a integer constant defined by you

    2) The send sms activity finish ( either cancelled or done with it’s job )

    3) onActivityResult will be call on your host activity with SEND_SMS_REQUEST_CODE.

    4) you can then do if( requestCode == SEND_SMS_REQUEST_CODE ) sendEmail();

    You can do the same thing for the send email activity.

    If you are interested on knowing what the child activity result was (ie: send sms cancelled or actually sent), you can use the onActivityResult resultCode parameter.

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

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have an array which has BIG numbers and small numbers in it. I
I know there's a lot of other questions out there that deal with this
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
I am currently running into a problem where an element is coming back from
I've got a string that has curly quotes in it. I'd like to replace

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.