InterviewSolution
Saved Bookmarks
| 1. |
Suppose we have to design an activity name as Contact Us. Where you have to provide an option to send an email. Can you please write the code in android to send an email to any specific email address? |
|
Answer» In “ContactUs” Activity I will add ONE more button for send SMS. When user will click on this button it will call Implicit INTENT with Action_View. But for SENDING SMS we NEED to add permission in our manifest.xml file. I have written below code for sending SMS in number “111-1111-111”. Uri smsUri = Uri.parse("tel:111-1111-111"); Intent intent = new Intent(Intent.ACTION_VIEW, smsUri); intent.putExtra("sms_body", "sms TEXT"); intent.setType("vnd.android-dir/mms-sms"); startActivity(intent); |
|