- 1
- 0
- 约9.83千字
- 约 10页
- 2017-08-23 发布于河南
- 举报
1.从google搜索内容
Intent intent = new Intent();
intent.setAction(Intent.ACTION_WEB_SEARCH);
intent.putExtra(SearchManager.QUERY,searchString)
startActivity(intent);
?
2.浏览网页
Uri uri =Uri.parse();
Intent it?= new Intent(Intent.ACTION_VIEW,uri);
startActivity(it);
?
3.显示地图
Uri uri = Uri.parse(geo:38.899533,-77.036476);
Intent it = newIntent(Intent.Action_VIEW,uri);
startActivity(it);
?
4.路径规划
Uri uri =Uri.parse(/maps?f=dsaddr=startLat%20startLngdaddr=endLat%20endLnghl=en);
Intent it = newIntent(Intent.ACTION_VIEW,URI);
startActivity(it);
?
5.拨打电话
Uri uri =Uri.parse(tel:xxxxxx);
Intent it = new Intent(Intent.ACTION_DIAL,uri);??
startActivity(it);
?
6.调用发短信的程序
方法1:
Intent it = newIntent(Intent.ACTION_VIEW);???
it.putExtra(sms_body, TheSMS text);???
it.setType(vnd.android-dir/mms-sms);???
startActivity(it);
?
7.发送短信
方法2:
Uri uri =Uri.parse(smsto:0800000123);???
Intent it = newIntent(Intent.ACTION_SENDTO, uri);???
it.putExtra(sms_body, TheSMS text);???
startActivity(it);
?
方法三:
String body=this is sms demo;
Intent mmsintent = newIntent(Intent.ACTION_SENDTO, Uri.fromParts(smsto, number, null));
mmsintent.putExtra(Messaging.KEY_ACTION_SENDTO_MESSAGE_BODY,body);
mmsintent.putExtra(Messaging.KEY_ACTION_SENDTO_COMPOSE_MODE,true);
mmsintent.putExtra(Messaging.KEY_ACTION_SENDTO_EXIT_ON_SENT,true);
startActivity(mmsintent);
?
8.发送彩信
Uri uri =Uri.parse(content://media/external/images/media/23);???
Intent it = newIntent(Intent.ACTION_SEND);???
it.putExtra(sms_body,some text);???
it.putExtra(Intent.EXTRA_STREAM, uri);???
it.setType(image/png);???
startActivity(it);
StringBuilder sb = new StringBuilder();
sb.append(file://);
sb.append(fd.getAbsoluteFile());
Intent intent = newIntent(Intent.ACTION_SENDTO, Uri.fromParts(mmsto, number, null));
// Below extra datas are all optional.
intent.putExtra(Messaging.KEY_ACTION_SENDTO_MESSAGE_SUBJECT,subject);
intent.putExtra(Messaging.KEY_ACTION_SENDTO_MESSAGE_BODY,body);
intent.putExtra(Messaging.KEY_ACTION_SENDTO_CONTENT_URI,sb.toString());
intent
原创力文档

文档评论(0)