You can let user choose it via Intent
as so:
Intent email = new Intent(Intent.ACTION_SEND); email.setType("message/rfc822"); email.putExtra(Intent.EXTRA_EMAIL,new String[]{ "[email protected]" }); email.putExtra(Intent.EXTRA_SUBJECT,"INSERT SUBJECT HERE"); email.putExtra(Intent.EXTRA_TEXT,"INSERT BODY HERE"); try{ Intent.createChooser( email, null ); }catch(ActivityNotFoundException e){ // WHATEVER }
Letting the default app handle the email:
Intent intent = new Intent(Intent.ACTION_VIEW); Uri data = Uri.parse("mailto:?subject=" + subject + "&body=" + body); intent.setData(data); startActivity(intent);
Explanation can be found here: https://stackoverflow.com/a/3312562/1894684
Related Posts:
- How do I link a JavaScript file to a HTML file?
- JavaScript runtime error: ‘$’ is undefined
- JavaScript Loading Screen while page loads
- Set selected option of select box
- Click button copy to clipboard
- How to make html table vertically scrollable
- How to make a simple image upload using Javascript/HTML
- How to make Bootstrap carousel slider use mobile left/right swipe
- How to Show External website inside another page without iFrame? [closed]
- bootstrap 3 navbar collapse button not working
- Display XML content in HTML page
- Bootstrap carousel not sliding
- Play/pause HTML 5 video using JQuery
- jQueryUI dialog width
- Clear form fields with jQuery
- How to call a webservice method from an html page [javascript] with out refresh the page
- Javascript – ERR_CONTENT_LENGTH_MISMATCH
- Random background images CSS3
- $(document).ready(function() is not working
- Show div #id on click with jQuery
- How do I remove a box-shadow effect from an element when another element is hovered?
- Slide right to left?
- jQuery UI Datepicker not working
- WP set auth cookie using Ajax is not saved to browser
- Basic WordPress AJAX Call
- Hide/show customizer controls based on other settings in Customizer
- Vimeo Froogaloop API, working in Fiddle but not WP
- WordPress site in China times out on requests to youtube [closed]
- Accordion scrolls page too low after clicking on the title [closed]
- WordPress Comments – Rich Text
- Adding a slide toggle on WordPress
- specifying relative file paths in WP with jQuery requests not working
- How to keep HTML form field that is conditional hidden with javasript hidden after page reload?
- Need workaround for insecure XMLHttpRequest endpoint request
- click event to unhide something after ajax not firing
- WP AJAX API with JS file
- Insert a Featured Video
- How to use JQuery Marquee in WordPress?
- JQuery script working locally on desktop, not working on WordPress + Divi
- Loop through WordPress API response errors
- Getting click on item to open closest relevant element (popup) with jQuery
- How can publish my bootstrap created table ( huge amount of data) on my word-press theme?
- jQuery for Fade Preload Causes My Site Favicon to Disappear from Tab of Browser
- how to allow download after newsletter subscription?
- jQuery function not working in WordPress but works in jsfiddle
- Site images are fixed in front of my site content [closed]
- How can I add a new lib path without call each one on the header?
- change the icon of a custom post type in WordPress to use twitter boostrap
- can’t make jQuery work (change image on time interval) [closed]
- Contact Form 7 – Submit Form not working After Ajax Request [closed]
- How to show a loading gif while an APi is being called in xamarin android?
- JavaScript sleep/wait before continuing [duplicate]
- JSON parsing error syntax error unexpected end of input
- Why does my JavaScript code receive a “No ‘Access-Control-Allow-Origin’ header is present on the requested resource” error, while Postman does not?
- Failed to load resource: the server responded with a status of 404 (Not Found) css
- How to properly use jsPDF library
- Android WebView err_unknown_url_scheme
- What does [object Object] mean? (JavaScript)
- How do I check whether a checkbox is checked in jQuery?
- ReferenceError: $ is not defined
- How do I check whether a checkbox is checked in jQuery?
- jQuery document.createElement equivalent?
- jQuery $(this) keyword
- Why does my JavaScript code receive a “No ‘Access-Control-Allow-Origin’ header is present on the requested resource” error, while Postman does not?
- How to set time delay in javascript
- Disable button in jQuery
- Pure JavaScript equivalent of jQuery’s $.ready() – how to call a function when the page/DOM is ready for it [duplicate]
- jQuery $(this) keyword
- JavaScript error (Uncaught SyntaxError: Unexpected end of input)
- Disable button in jQuery
- Automatically pausing html5 video as the ‘next’ button is pressed (javascript/ jquery)
- JavaScript error (Uncaught SyntaxError: Unexpected end of input)
- Failed to load resource: the server responded with a status of 404 (Not Found) css
- How to wait 5 seconds with jQuery?
- Submit a form using jQuery
- How to Handle Button Click Events in jQuery?
- How can I scroll to an element using jQuery?
- jQuery.click() vs onClick
- jQuery Get Selected Option From Dropdown
- How to enable CORS in flask
- Check if checkbox is checked with jQuery
- How can I get the ID of an element using jQuery?
- How to add jQuery code into HTML Page
- jQuery equivalent of JavaScript’s addEventListener method
- How can I get the data-id attribute?
- Check if checkbox is checked with jQuery
- Should I use .done() and .fail() for new jQuery AJAX code instead of success and error
- Pass request headers in a jQuery AJAX GET call
- $.ajax – dataType
- what does jQuery data() function do
- How to show loading spinner in jQuery?
- Getting net::ERR_UNKNOWN_URL_SCHEME while calling telephone number from HTML page in Android
- How can I get the ID of an element using jQuery?
- What is content-type and datatype in an AJAX request?
- jQuery Selector: Id Ends With?
- Adding attribute in jQuery
- speedtest.net api
- jQuery dialog popup
- data.map is not a function
- How do you select a particular option in a SELECT element in jQuery?