admin管理员组文章数量:1435349
标题有点长,不多说
Intent intent=new Intent(Intent.ACTION_GET_CONTENT);
intent.setType("text/plain");
intent.addCategory(Intent.CATEGORY_OPENABLE);
startActivityForResult(intent,REC_REQUESTCODE);
其中“text/plain”是文件的后缀名所对应的MIME类型
当指定两种或两种以上指定文件类型格式是:
//intent.setType("video/*;image/*");//同时选择视频和图片
随手贴上常用的MIME类型
//{后缀名,MIME类型}
{
".3gp", "video/3gpp"},
{
".apk", "application/vnd.android.package-archive"},
{
".asf", "video/x-ms-asf"},
{
".avi", "video/x-msvideo"},
{
".bin", "application/octet-stream"},
{
".bmp", "image/bmp"},
{
".c", "text/plain"},
{
".class", "application/octet-stream"},
{
".conf", "text/plain"},
{
".cpp", "text/plain"},
{
".doc", "application/msword"},
{
".docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document"},
{
".xls", "application/vnd.ms-excel"},
{
版权声明:本文标题:android调用自带文件选择器获取指定文件,编写解析Uri获取文件绝对路径 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/biancheng/1726386409a1086231.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论