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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:45:33+00:00 2026-05-27T20:45:33+00:00

Ok I am trying to take a string and put it into the intent

  • 0

Ok I am trying to take a string and put it into the intent section so i can get the app to send an email. I cannot for the life of me figure out how to do this. NOTE: I am new to java/android programming. I know this will pull up an option for the user to choose what they want to send it with. I would really like to have to app send the email and give them a confirmation, but do not know if that is possible.

Here is my main.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >

    <TextView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="@string/welcome" />

    <EditText
        android:id="@+id/EditTextName"
        android:layout_height="wrap_content"
        android:hint="@string/name"
        android:inputType="textPersonName"
        android:layout_width="fill_parent">
    </EditText>

    <EditText
        android:id="@+id/EditTextEmail"
        android:layout_height="wrap_content"
        android:hint="@string/email"
        android:inputType="textEmailAddress"
        android:layout_width="fill_parent">
    </EditText>

    <Spinner
        android:id="@+id/SpinnerStatus"
        android:layout_height="wrap_content"
        android:prompt="@string/status"
        android:layout_width="fill_parent"
        android:entries="@array/statuslist">
    </Spinner>

    <EditText  
        android:id="@+id/EditTextChangeBody"  
        android:layout_height="wrap_content"  
        android:hint="@string/changebody"  
        android:inputType="textMultiLine"  
        android:lines="5"  
        android:layout_width="fill_parent">  
    </EditText>

    <Button
        android:id="@+id/ButtonSendChange"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:onClick="sendChange"
        android:text="@string/changebutton">
    </Button>

</LinearLayout>

Here is my MadisonStudios.java

package com.madisonstudios.supportapp;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.Spinner;

public class MadisonStudios extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    }

    public void sendChange(View button) {  
        final EditText nameField = (EditText) findViewById(R.id.EditTextName);  
        String name = nameField.getText().toString();  

        final EditText emailField = (EditText) findViewById(R.id.EditTextEmail);  
        String email = emailField.getText().toString();  

        final EditText feedbackField = (EditText) findViewById(R.id.EditTextChangeBody);  
        String changes = feedbackField.getText().toString();

        final Spinner feedbackSpinner = (Spinner) findViewById(R.id.SpinnerStatus);  
        String status = feedbackSpinner.getSelectedItem().toString();

        Intent it = new Intent(Intent.ACTION_SEND);
        String[] tos = {getString(R.string.email)};
        it.putExtra(Intent.EXTRA_EMAIL, tos);
        it.putExtra(Intent.EXTRA_SUBJECT, getString(R.string.emailSubject));
        it.setType("text/plain");
        startActivity(it);
    } 
}
  • 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-27T20:45:34+00:00Added an answer on May 27, 2026 at 8:45 pm

    You can access getString() from a context or its subclass like activity,

    to get a string you need to do the following

    activity.getString(R.string.xyz)

    You can pass a string to another activity like the following code does.

        final Intent activityIntent = new Intent(
                    activity.getApplicationContext(), CurrentActivity.class);
            activityIntent .putExtra("ID",
                    item.ID);
            activityIntent .putExtra("NAME",
                    item.name);
            activity.startActivity(activityIntent);
    

    You can send an email using the following code

    public static void sendEmail(final Activity activity,final String email) {
    
        /* Create the Intent */
        final Intent emailIntent = new Intent(
                android.content.Intent.ACTION_SEND);
    
        /* Fill it with Data */
        emailIntent.setType("plain/text");
        emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL,
                new String[] {email });
        emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT,
                "Feedback");
    
        emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, "");
        /* Send it off to the Activity-Chooser */
        activity.startActivity(Intent.createChooser(emailIntent,
                "Send feedback"));
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to take values from a table and put them into a string
Basic question here, can I put String variables into a position in a string
I am trying to take the entire post array and put each value into
Im trying to get this program to take the users input and put that
I am trying to take the string <BR> in VB.NET and convert it to
I'm trying to take a text string, (e.g. the word testing) and calculating if
I'm trying to take a numeric value in a string and raise it by
I'm trying to find the amount of space/width that a string would take when
I am trying to take a rather large CSV file and insert it into
In this loop, I'm trying to take user input and continually put it in

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.