比如说有.txt,.doc,还有其他的一些格式都可以对应一个text对应的格式,那么我们就可以把这些归到一个return this MIME type:vnd.android.cursor.item/vnd.example.text
然后就可以使用这个做对应的打开方式的动作(可以打开所有文本文件的动作)

解决方案 »

  1.   

    The type depends in part on whether or not the content:
     URI submitted to getType() limits the request to a specific record. 
    There's one form of the MIME type for a single record and another for multiple records. 
    Use the Uri methods to help determine what is being requested. (官网doc)
      

  2.   

    顶一下,还是没有说清楚
    不要复制DOC
      

  3.   

    我靠,复制doc又怎么了,人家里面说的挺清楚了这个的作用!!!!我只是拿出来给你强调下!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
      

  4.   

    ContentProvider用getType(Uri uri)返回uri代表数据的MIME类型,如果该数据可能包含多条记录,MIME类型字符串以vnd.android.cursor.dir/开头,如果该数据只包含一条数据,以vnd.android.cursor.item/开头。