在android,internt.setDataAndType()是什么用?

在学android从相机拍照和从相册选择照片,分别出现了:

 intent.setDataAndType(imageUri,"image/*");
 intent.setType("image/*");

这两句代码我不是很明白具体作用

1.setType(String type):Set an explicit MIME data type.即设置mime数据类型
2.setDataAndType(Uri data, String type):(Usually optional) Set the data for the intent along with an explicit MIME data type.。即为intent设置一个mime类型的数据

intent.setType(String type)对应源码:
    public Intent setType(String type) {
    mData = null;
    mType = type;
    return this;
}
    设置type

    intent.setDataAndType(Uri data, String type)的源码:
        public Intent setDataAndType(Uri data, String type) {
    mData = data;
    mType = type;
    return this;
}
    同时设置数据uri,type

    intent.setData()的源码
 public Intent setData(Uri data) {
    mData = data;
    mType = null;
    return this;
}
设置数据uri

http://blog.csdn.net/gf771115/article/details/7827527