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

  • Home
  • SEARCH
  • 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 6004045
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T01:12:27+00:00 2026-05-23T01:12:27+00:00

I am currently working on an Android application which has an order form. I

  • 0

I am currently working on an Android application which has an order form. I would like to know how I can allow the application to capture what the user has input and send the input directly to an email using button, without bringing the user to the email app page. I know my .java class has errors, however, I am trying out… Below is my xml (layout) file and my .java class file. Please help me… Thanks!!

Here is my .xml file (layout)

<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent"
    android:stretchColumns="1">
<TextView
    android:id="@+id/txtname"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Name: "
    />
<EditText
    android:id="@+id/editname"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_below="@id/txtname"
    android:hint="Your name please"
    />
<TextView
    android:id="@+id/txtemail"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_below="@id/editname"
    android:text="Email Address: "
    />
<EditText
    android:id="@+id/editemail"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_below="@id/txtemail"
    android:hint="Enter email address here"
    />
<TextView
    android:id="@+id/txtnum"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_below="@id/editemail"
    android:text="Contact Number: "
    />
<EditText
    android:id="@+id/editnum"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_below="@id/txtnum"
    android:hint="Enter contact number here"
    />
<TextView
    android:id="@+id/txtadd"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_below="@id/editnum"
    android:text="Mailing Address: "
    />
<EditText
    android:id="@+id/editadd"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_below="@id/txtadd"
    android:hint="Enter mailing address here"
    />
<TextView
    android:id="@+id/txtitems"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_below="@id/editadd"
    android:text="Item(s): "
    />
<EditText
    android:id="@+id/edititems"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_below="@id/txtadd"
    android:hint="Enter item(s) here"
    />
<Button
    android:id="@+id/btn_submit"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_below="@id/edititems"
    android:text="Submit form"
    />
</TableLayout>

Here is my .java class codes

public class OrderFormActivity extends Activity implements OnClickListener{
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.orderform);

    Button btnsubmit = (Button)findViewById(R.id.btn_submit);
    btnsubmit.setOnClickListener(this);
}

@Override
public void onClick(View v) {
    // TODO Auto-generated method stub
    if (v == this.findViewById(R.id.btn_submit)) {

    EditText name = (EditText)findViewById(R.id.editname);
    String strname = name.getText().toString();

    EditText email = (EditText)findViewById(R.id.editemail);
    String stremail = email.getText().toString();

    EditText num = (EditText)findViewById(R.id.editnum);
    String strnum = num.getText().toString();

    EditText add = (EditText)findViewById(R.id.editadd);
    String stradd = add.getText().toString();

    EditText items = (EditText)findViewById(R.id.edititems);
    String stritems = items.getText().toString();

    showOrder(strname, stremail, strnum, stradd,stritems);
    }

}

private void showOrder (String strname, String stremail, String strnum, String stradd, String stritems) {
    String result = strname + stremail + strnum + stradd + stritems;

    //Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);

    String emailAddress = "kwok.winona@gmail.com";

    Intent intent = new Intent(Intent.ACTION_SEND);  
    intent.setType("plain/text");
    intent.putExtra(Intent.EXTRA_EMAIL, emailAddress);    
    intent.putExtra(Intent.EXTRA_TEXT, result);         

}

}

Thanks all again in advance!!! 😀

  • 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-23T01:12:27+00:00Added an answer on May 23, 2026 at 1:12 am

    There is no API to send an email through intents without user interaction. This has been repeated several times here in SO.

    As pearsonartphoto suggested, you need to use an external library to send the email. JavaMail is the clear first option, even if you “found that solution too cumbersome”.

    So you need to gather all the fields as you posted, format the in a useful way for the email (perhaps xml, perhaps JSON?) and send it as text with JavaMail.

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

Sidebar

Related Questions

I am creating an android application which has to execute web requests in the
I am currently developing an application which has a maps feature. My map is
I'm working on an Android Application for AutiPlan, which is a web-based planner tool
Currently I am working on an Android application that is dynamically creating controls. Everytime
The system I am currently working on requires some role-based security, which is well
The company I'm currently working for is using Selenium for Uniting-Testing our User Interface.
I'm currently working on an internal sales application for the company I work for,
I'm currently working on an application with a frontend written in Adobe Flex 3.
I have a TextView in my android application that has a set width on
I have just started working on my first Android application and am going ok.

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.