相当一部分来自文档,希望能有朋友继续完善此贴,以作搜藏。

显示网页:

1. Uri uri = Uri.parse("http://www.google.com");
2. Intent it = new Intent(Intent.ACTION_VIEW,uri);
3. startActivity(it);

显示地图:

1. Uri uri = Uri.parse("geo:38.899533,-77.036476");
2. Intent it = new Intent(Intent.Action_VIEW,uri);
3. startActivity(it);

路径规划:

1. Uri uri = Uri.parse("http://maps.google.com/maps?f=d&saddr=startLat%20startLng&daddr=endLat%20endLng&hl=en");
2. Intent it = new Intent(Intent.ACTION_VIEW,URI);
3. startActivity(it);

拨打电话:
调用拨号程序

1. Uri uri = Uri.parse("tel:xxxxxx");
2. Intent it = new Intent(Intent.ACTION_DIAL, uri);
3. startActivity(it);

1. Uri uri = Uri.parse("tel.xxxxxx");
2. Intent it =new Intent(Intent.ACTION_CALL,uri);
3. 要使用这个必须在配置文件中加入<uses-permission id="android.permission.CALL_PHONE" />

发送SMS/MMS
调用发送短信的程序

1. Intent it = new Intent(Intent.ACTION_VIEW);
2. it.putExtra("sms_body", "The SMS text");
3. it.setType("vnd.android-dir/mms-sms");
4. startActivity(it);

发送短信

1. Uri uri = Uri.parse("smsto:0800000123");
2. Intent it = new Intent(Intent.ACTION_SENDTO, uri);
3. it.putExtra("sms_body", "The SMS text");
4. startActivity(it);

发送彩信

1. Uri uri = Uri.parse("content://media/external/images/media/23");
2. Intent it = new Intent(Intent.ACTION_SEND);
3. it.putExtra("sms_body", "some text");
4. it.putExtra(Intent.EXTRA_STREAM, uri);
5. it.setType("image/png");
6. startActivity(it);

发送Email

1.
2. Uri uri = Uri.parse("mailto:xxx@abc.com");
3. Intent it = new Intent(Intent.ACTION_SENDTO, uri);
4. startActivity(it);

1. Intent it = new Intent(Intent.ACTION_SEND);
2. it.putExtra(Intent.EXTRA_EMAIL, "me@abc.com");
3. it.putExtra(Intent.EXTRA_TEXT, "The email body text");
4. it.setType("text/plain");
5. startActivity(Intent.createChooser(it, "Choose Email Client"));

1. Intent it=new Intent(Intent.ACTION_SEND);
2. String[] tos={"me@abc.com"};
3. String[] ccs={"you@abc.com"};
4. it.putExtra(Intent.EXTRA_EMAIL, tos);
5. it.putExtra(Intent.EXTRA_CC, ccs);
6. it.putExtra(Intent.EXTRA_TEXT, "The email body text");
7. it.putExtra(Intent.EXTRA_SUBJECT, "The email subject text");
8. it.setType("message/rfc822");
9. startActivity(Intent.createChooser(it, "Choose Email Client"));

添加附件

1. Intent it = new Intent(Intent.ACTION_SEND);
2. it.putExtra(Intent.EXTRA_SUBJECT, "The email subject text");
3. it.putExtra(Intent.EXTRA_STREAM, "file:///sdcard/mysong.mp3");
4. sendIntent.setType("audio/mp3");
5. startActivity(Intent.createChooser(it, "Choose Email Client"));

播放多媒体

1.
2. Intent it = new Intent(Intent.ACTION_VIEW);
3. Uri uri = Uri.parse("file:///sdcard/song.mp3");
4. it.setDataAndType(uri, "audio/mp3");
5. startActivity(it);

1. Uri uri = Uri.withAppendedPath(MediaStore.Audio.Media.INTERNAL_CONTENT_URI, "1");
2. Intent it = new Intent(Intent.ACTION_VIEW, uri);
3. startActivity(it);

Uninstall 程序

1. Uri uri = Uri.fromParts("package", strPackageName, null);
2. Intent it = new Intent(Intent.ACTION_DELETE, uri);
3. startActivity(it);

转载自csdn论坛

http://topic.csdn.net/u/20100824/08/d11283b5-b7ab-432a-85bb-4e8e9248d271.html?88915

更多相关文章

  1. 我的Android学习笔记2(学Android怎能不懂java)
  2. Eclipse+CDT+GDB调试android NDK程序
  3. The import org.cocos2dx.lib cannot be resolved AppActivity.j
  4. Android——为图片增加水印,并且保存到图库刷新
  5. 【译】如何在 Android(安卓)中使用 Retrofit, Moshi, Coroutines
  6. Android(安卓)开机自启动应用
  7. Android(安卓)Input设备debug技巧
  8. android 使用 ffmpeg 进行视频转码(一)
  9. Security and Permissions 安全与权限 (一)

随机推荐

  1. Android之TabLayout布局的使用
  2. Android 之 向模拟器的sdcard中添加文件
  3. Android 绘图基础:Canvas,Paint,RectF,Paint
  4. Android(安卓)VideoView通过Intent.ACTIO
  5. android viewpager+fragment做主界面(超
  6. Android 实习生面试经历记录
  7. findViewById替代方案:Android Jetpack MV
  8. Android移植到PXA270开发板
  9. Android 计算器的开发
  10. Android与服务器端数据交互(http协议整合s