Android Intent设置类型setType();
2016-05-12 09:37
483 查看
android Intent大家都很熟悉了,是连接各大组件的桥梁,调用意图发送短信,彩信,打开指定网页,打开照相机,读取相册图片等等...
这里介绍两个平时用的比较多的两种意图:
一.调用手机默认分享
二.读取相册图片
这里介绍两个平时用的比较多的两种意图:
一.调用手机默认分享
Intent it = new Intent(Intent.ACTION_SEND);</strong></span> it.putExtra(Intent.EXTRA_TEXT, "分享测试"); it.setType("text/plain"); startActivity(Intent.createChooser(it, "分享内容到"));</strong></span>
二.读取相册图片
Intent it = new Intent(Intent.ACTION_GET_CONTENT); it.setType("image/*"); startActivity(it);</span></strong>
相关文章推荐
- Android Intent设置类型setType()-调用手机默认分享和读取相册图片
- android模拟器启动不了,出现乱码提示
- Android Material Design之Toolbar与Palette实践
- android 用一半透明的view a覆盖view b 为什么view b 还能获得焦点?
- Android 特殊符号的ASCII转码
- Android Studio中的快捷键介绍
- Android例子源码非第三方实现根据字母排序的城市列表
- Android之自定义生成彩色二维码
- android 百度地图定位开发1
- android 百度地图定位开发2
- Android 二维码扫描框 加四个角及中间横线自动下滑
- Android PullToRefresh (ListView GridView 下拉刷新) 使用详解
- Android PullToRefresh (GridView 下拉刷新上拉加载)
- Android生成一维码
- Android JPush(极光推送)的使用教程
- Android_按两次返回键退出程序和长按返回键退出程序
- Android判断网路是否畅通加权限
- android 断点下载---XUtils
- Android 仿QQ消息界面
- Android 去除最上面应用名称及图标