1.打开网页
- Uri uri = Uri.parse(\"http://www.google.com.hk\");
- Intent intent = new Intent(Intent.ACTION_VIEW, uri);
- startActivity(intent);
- /* 必须使用Google APIs包 */
- Uri uri = Uri.parse(\"geo:113.46,22.27\");
- Intent it = new Intent(Intent.ACTION_VIEW, uri);
- startActivity(it);
- Uri uri = Uri.parse(\"tel:15013580650\");
- Intent intent = new Intent(Intent.ACTION_DIAL, uri);
- startActivity(intent);
Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse(\"tel:\"+ \"10086\"));
startActivity(intent);
- /* 必须加上android.permission.CALL_PHONE权限 */
- Uri uri = Uri.parse(\"tel:15013580650\");
- Intent intent = new Intent(Intent.ACTION_CALL, uri);
- startActivity(intent);
通话记录:
Intent intent = new Intent(Intent.ACTION_CALL_BUTTON);
startActivity(intent);
startActivity(intent);
- Intent intent = new Intent(Intent.ACTION_VIEW);
- intent.putExtra(\"sms_body\", \"这里输入短信内容\");
- intent.setType(\"vnd.android-dir/mms-sms\");
- startActivity(intent);
短信记录:
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.setData(Uri.parse(\"content://mms-sms/\"));
startActivity(intent);
- Uri uri = Uri.parse(\"smsto:5554\");
- Intent intent = new Intent(Intent.ACTION_SENDTO, uri);
- intent.putExtra(\"sms_body\", \"这里输入短信内容\");
- startActivity(intent);
- // 发送彩信的图片路径
- Uri uri = Uri.parse(\"file:///sdcard/handou.png\");
- Intent intent = new Intent(Intent.ACTION_SEND);
- intent.putExtra(\"sms_body\", \"这里输入信息内容\");
- // 彩信附件
- intent.putExtra(Intent.EXTRA_STREAM, uri);
- // 文件类型
- intent.setType(\"image/png\");
- startActivity(intent);
- String[] tos = {\"doctang@163.com\"};
- String[] ccs = {\"tangmin@163.com\"};
- Intent intent = new Intent(Intent.ACTION_SEND);
- intent.putExtra(Intent.EXTRA_EMAIL, tos);
- intent.putExtra(Intent.EXTRA_CC, ccs);
- intent.putExtra(Intent.EXTRA_TEXT, \"邮件正文\");
- intent.putExtra(Intent.EXTRA_SUBJECT, \"邮件主题\");
- //intent.putExtra(Intent.EXTRA_STREAM, \"file:///sdcard/handou.png\");
- intent.setType(\"text/plain\");
- startActivity(intent);