Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

182
Vistas
Android Studio Email Intent. Have recipient field filled when opening email client

i'm fairly new to java and i'm having a problem with email intents. I am developing an app and i made an email intent but i dont know how to make sure that the recipient field isn't the result of the user input in an edit text box, i want that removed so it only shows the "subject" and "message" box in the app. i want the recipient field already filled when you tap "send". Here is my code

 editTextSubject=(EditText)findViewById(R.id.editText2);
    editTextMessage=(EditText)findViewById(R.id.editText3);

    send=(Button) findViewById(R.id.button1);

    send.setOnClickListener(new View.OnClickListener(){

        @Override
        public void onClick(View arg0) {

            String[] recipients = new String[]{"email@gmail.com"};
            String subject=editTextSubject.getText().toString();
            String message=editTextMessage.getText().toString();





            Intent email = new Intent(Intent.ACTION_SEND);
            email.putExtra(Intent.EXTRA_EMAIL, recipients );
            email.putExtra(Intent.EXTRA_SUBJECT, subject);
            email.putExtra(Intent.EXTRA_TEXT, message);

            email.setType("message/rfc822");
            startActivity(Intent.createChooser(email,"Choose an Email client :"));
over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

Here the code I used to send a new email

   public void contact() {
            final Intent send = new Intent(Intent.ACTION_SENDTO);

            final String email = "youremail@gmail.com";
            final String subject = "subject";
            final String body = "body...";

            final String uriText = "mailto:" + Uri.encode(email) +
                    "?subject=" + Uri.encode(subject) +
                    "&body=" + Uri.encode(body);
            final Uri uri = Uri.parse(uriText);

            send.setData(uri);
            startActivity(Intent.createChooser(send, getString(R.string.settings_email_chooser)));
        }
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda