Preface
This chapter is about android.net. MailTo. The version is Android 3.0 r1! I look forward to your participation in Android API translation, contact me over140@gmail.com.
Statement
You are welcome to repost, but please keep the original source of the article :)
Blog Garden: http://www.cnblogs.com/
Android Chinese translation group: http://goo.gl/6vJQl
Body
I. Structure
Public class MailTo extends Object
Java. lang. Object
Android.net. MailTo
Ii. Category Overview
MailTo URL parser. This class resolves the email to the URL plan (a mailto schema URL can be found here) and can be used to parse parameter queries. It implements the RFC 2368 protocol.
3. Constants
Public static final StringMAILTO_SCHEME
Constant Value: "mailto :"
Iv. Public Methods
Public StringGetBody()
Obtain the body of the email from a Url. If no body content is set, null is returned.
Return Value
Returns the body or null.
Public StringGetCc()
Obtain the CC address from a Url. This may be a space separated by commas (,) for multiple email addresses. If no CC address is specified, null is returned.
Return Value
Email Addresses separated by commas (,) or null
Public Map <String, String>GetHeaders()
Get the mail header from a Url (Android123: such as the encoding type, sending time, IP address, etc)
Return Value
Map containing resolution Value
Public StringGetSubject()
Obtain a topic from a Url. If no topic row is specified, null is returned.
Return Value
Topic or null
Public StringGetTo()
Get the recipient from a Url. This may be a space separated by commas (,) for multiple email addresses. If this parameter is not specified, null is returned.
Return Value
Email Addresses separated by commas (,) or null.
Public static booleanIsMailTo(String url)
Test whether the specified string contains the Email Url.
Parameters
Url string used for testing
Return Value
If it is true, the string is the Url containing the Email.
Public static MailToParse(String url)
Parses the specified Url string into A MailTo class. RFC 2368 implemented by this parser. The returned object can be used to query parsed parameters.
Parameters
The url contains the Url string of the Email.
Return Value
MailTo object
Exception
ParseException if the structure does not contain the Email Url, this exception is thrown.
Public StringToString()
Returns a string that contains concise and understandable objects. Child classes are encouraged to override this method and provide an implementation that takes into account the object type and data. The default implementation price is based on the following expression:
If you want to implement your own toString method, see Writing a usefultoString
Method.
Return Value
The printable output of this object.
5. Supplement
Article Link
Email parsing android.net. MailTo class (see this link for translation)