Adding text from edit text field into an email

后端 未结 1 1633
予麋鹿
予麋鹿 2021-01-15 12:59

I have an app and want to have a contact us for where the user inputs their name, address, phone number, and a comment section. Then they will click on compose mail button

相关标签:
1条回答
  • 2021-01-15 13:31

    You can put all data inside email.putExtra(android.content.Intent.EXTRA_TEXT, "Sent from the Lads to Leaders/Leaderettes Android App");

    First Get all EditText by ID here in oncreate Like

     EditText name = (EditText) findViewById(R.id.editext1);
     EditText address = (EditText) findViewById(R.id.editext2);
     EditText phone = (EditText) findViewById(R.id.editext3);
    

    Then put all data

    email.putExtra(android.content.Intent.EXTRA_TEXT, 
    "name:"+name.getText().toString()+"address:"+address.getText().toString()+"phone:
     "+phone.getText().toString());
    

    Enjoy :)

    0 讨论(0)
提交回复
热议问题