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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T13:30:23+00:00 2026-06-15T13:30:23+00:00

I am developing form based application. The form includes Customer details. when he click

  • 0

I am developing form based application. The form includes Customer details. when he click on the submit button, the details of the form is included as email body.

Below is my code:

Orders.java

import android.app.Activity;    
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

public class Order extends Activity{
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.order);
        final EditText name   = (EditText)findViewById(R.id.username);
        final EditText mail   = (EditText)findViewById(R.id.email);
        final EditText phone   = (EditText)findViewById(R.id.phone);
        final EditText product   = (EditText)findViewById(R.id.product);
        final String _name = name.getText().toString();
        final String _mail = mail.getText().toString();
        final String _phone = phone.getText().toString();
        final String _product = product.getText().toString();
        System.out.println(_name);
        System.out.println(_mail);
        System.out.println(_phone);
        System.out.println(_product);
        Button email = (Button) findViewById(R.id.Button01);
        email.setOnClickListener(new OnClickListener(){  
                  public void onClick(View v){
                  String[] recipients = new String[]{"b.gadwantikar1@gmail.com", "",};
                      StringBuilder body = new StringBuilder();
                      StringBuilder body1 = new StringBuilder();
                      body1.append("To: " + recipients);
                      body.append("Name: "+name.getText().toString());
                      body.append("\n\n\nMail: "+mail.getText().toString());
                      body.append("\n\n\nPhone: "+phone.getText().toString());
                      body.append("\n\n\nProduct: "+product.getText().toString());
                      Intent i = new Intent(android.content.Intent.ACTION_SEND);
                      i.setType("text/plain");
                      i.putExtra(android.content.Intent.EXTRA_EMAIL, body1.toString());
                      i.putExtra(android.content.Intent.EXTRA_SUBJECT, "Customer Details");
                      i.putExtra(android.content.Intent.EXTRA_TEXT, body.toString());
startActivity(i);
}
});
}
}

xml file is:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >    

    <EditText
        android:layout_width="60dip"
        android:layout_height="wrap_content"
        android:id="@+id/edit"/>

    <Button
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/btn"
        android:text="Click"/>    
</LinearLayout>

I am getting the mail id which is given in program in “from : ” field but I want that one in “to : ” field …

  • 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-15T13:30:25+00:00Added an answer on June 15, 2026 at 1:30 pm
    StringBuilder body = new StringBuilder();
    body.append("Name: "+nameField.getText().toString());
    body.append("\nAge: "+ageField.getText().toString());
    body.append("\nGender: "+genderField.getText().toString());
    
    // Sending to admin
    Intent i = new Intent(Intent.ACTION_SEND);
    i.setType("text/plain");
    i.putExtra(Intent.EXTRA_EMAIL, new String[] {"admin@gmail.com"} );
    i.putExtra(Intent.EXTRA_SUBJECT, "Customer Details");
    i.putExtra(Intent.EXTRA_TEXT, body.toString());
    startActivity(i);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We are developing C#.Net 4.0 Windows form based application using Microsoft.Office.Interop.Word reference. Now I
We are developing C# .net 4.0 Windows Form Based Application. Here, User Will enter
I am developing a web application which has form based authentication. All pages needs
I'm developing a PHP-based web-application in which you have a form with textarea inputs
I am developing a spring mvc based application. I have a simple pojo form
I am Developing Windows Form Application in .Net, I want to insert selected rows
I am developing UI form that has infragistics grid. Users can delete, submit some
i'm developing a windows form application.in the form, the left part is a tree
I'm developing a search form. It has about 10 fields and a search button
I am developing a windows based application in .net. I have two forms. Form2

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.