Head First Android --- Intent

How to create the intent
You create an intent that specifies an action using the following syntax:where action is the type of activity action you want to perform.
Android provides you with a number of standard actions you can use. As an example,you can use Intent.ACTION_DIAL to dial a number,

Intent.ACTION_WEB_SEARCH to perform a web search, and Intent.ACTION_SEND to send a message. So, if you want to create an
intent that specifies you want to send a message, you use:

Intent intent = new Intent(Intent.ACTION_SEND);

intent.setType("text/plain");
intent.putExtra(Intent.EXTRA_TEXT, messageText);

 

posted @ 2018-10-28 21:44  zjf2018  阅读(174)  评论(0)    收藏  举报